
This is anacron (like `anac(h)ronistic') -- a cron-like program
that doesn't go by time.

It is useful for jobs, that don't have to run at a certain time, but
in a certain period. (That's why anacron was formerly called `pe', which
stands for periodic execution.)

Anacron is a simple perl script, that reads the file /etc/anacrontab
when started. This file contains several jobs, that has to be executed
(for example to clean up /tmp, etc.), plus an interval in days, how
often this command has to be run. Anacron simply checks when the
individual jobs were executed last time and if its necessary to run
them.

Note that anacron is not a daemon like crond, but a simple program that
fires off the programs in background and exits immediately after that.
This makes it easy to use anacron on systems that run continously
(e.g. an Internet server) and on systems that are switched on and off
several times a day (e.g. your desktop PC).

It is suggested to run anacron automatically after boot up and, in addition,
via a cron entry, say at 01:00am, so anacron checks for the jobs at least
once per day. (You need the cron entry in case you leave your system on
for more than a day.)

On a Debian system, anacron is best used for controlling the jobs in
the /etc/cron.daily, /etc/cron.weekly, and /etc/cron.monthly, that
are automatically installed by many packages. Here is a sample
anacrontab file for this:

-----------------------------------------------------------------------
# /etc/anacrontab: configuration file for anacron(8)

SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

# See anacron(8) for details.

# Use the following entries if you have a Debian system
# (and don't forget to remove the corresponding lines in crontab)
1      10      cron.daily      run-parts /etc/cron.daily
7      15      cron.weekly     run-parts /etc/cron.weekly
30     20      cron.monthly    run-parts /etc/cron.monthly

-----------------------------------------------------------------------

The first number tells anacron the interval in days (i.e. the period)
how often the job should be executed. The second number is the time
to wait (minutes) before actually starting the job. This is useful so
that the jobs don't get started all together at boot up when you try
to log in and start your applications. The third parameter is used
as job id in the log files.

The job itself is specified in the last parameters.

Whenever you want to include a comment in the anacrontab file just
add a hash character (#) and everything up to the end-of-line is
ignored.

If your jobs need a specific environment, just add lines of the form
	VAR=PARAM
and anacron will set this environment variables before executing the
jobs.

(Please have a look at the manual pages anacron(8) and anacrontab(5) for 
further description of the syntax.)

Then you should change a few entries in the crontab file. The old
entries, that told cron to run the scripts in /etc/cron.* directories
should be commented out:

#42 6   * * *   root    run-parts /etc/cron.daily
#47 6   * * 7   root    run-parts /etc/cron.weekly
#52 6   1 * *   root    run-parts /etc/cron.monthly

and you should add an entry for anacron:

0 1   * * *   root    /usr/bin/anacron

If you want to see what anacron is doing, you can have a look at the log
file /var/log/anacron.

That's all!

--
Christian Schwarz <C.Schwarz@monet.m.isar.de>

