HOME‎ > ‎

anacronsim

If your systems is designed to power down when it isn't busy, you will find that some of your daily, weekly and monthly cronjobs never run. The fallout is that some of the automated maintenance tasks, such as ensuring that log files don't grow forever, never run.  A full explanation of the problem can be found here. anacron is the name of a utility that solves this problem and was available in older versions of Knoppmyth. Unfortunately, it does not appear to be available in LINHES 6.03, so I write a simple script that "simulates" the effect of anacron. In essence, this script will ensure that daily jobs are run no more often than once/day; weekly no more than once/week; and monthly no more than once/month. To install this script on a working LINHES 603 system, take the following steps:

  1. Download anacronsim.tgz and untar its contents into a directory such as /usr/local/bin
  2. Edit your crontab file ("crontab -e") and
    1. Comment out the lines that run "/etc/cron.daily", "/etc/cron.weekly" and "/etc/cron.monthly".
    2. Add a line that runs /usr/local/bin/anacromsim every 30 minutes. 
If you have done this correctly, "crontab -l" should look something like this:
#
# DO NOT EDIT THIS FILE MANUALLY!! USE crontab -e INSTEAD.
#

# <minute> <hour> <day> <month> <dow> <command>

01 * * * *  /usr/sbin/run-cron /etc/cron.hourly
03,33 * * * * /usr/local/bin/anacronsim
# 02 00 * * * /usr/sbin/run-cron /etc/cron.daily
# 22 00 * * 0 /usr/sbin/run-cron /etc/cron.weekly
# 42 00 1 * * /usr/sbin/run-cron /etc/cron.monthly

Subpages (1): Downloads
Comments