anacrontab

Autres langues

Langue: en

Version: 384664 (fedora - 01/12/10)

Section: 5 (Format de fichier)

NAME

/etc/anacrontab - configuration file for anacron

DESCRIPTION

The file /etc/anacrontab describes the jobs controlled by anacron(8). Its lines can be of three kinds: job-description lines, environment assignments, or empty lines.

Job-description lines are of one of these two forms:


   period  delay  job-identifier  command


   @period_name delay job-identify command

The period is specified in days, the delay in minutes. If the RANDOM_DELAY environment variable is set, then a random value between 0 and RANDOM_DELAY minutes will be added to the start up delay of the jobs. For example a RANDOM_DELAY set to 12 would therefore add, randomly, between 0 and 12 minutes to the user defined delay. The job-identifier can contain any non-blank character, except slashes. It is used to identify the job in Anacron messages, and as the name for the job's timestamp file. The command can be any shell command. The fields can be seperated by blank spaces or tabs. The period_name can be set to daily, weekly, monthly, yearly or annualy. This will ensure jobs are run once a week, month or year no matter the number of days in this period.

Environment assignment lines are of the form:


   VAR = VALUE

Spaces around VAR are removed. No spaces around VALUE are allowed (unless you want them to be part of the value). The assignment takes effect from the next line to the end of the file, or to the next assignment of the same variable. The enviroment variable START_HOURS_RANGE sets the time frame, when the job could started.

Empty lines are either blank lines, line containing white-space only, or lines with white-space followed by a '#' followed by an arbitrary comment.

You can continue a line onto the next line by ending it with a '\'.

In case there is need for having anacron off, then it can be done by adding cron job 0anacron into /etc/cron.hourly/jobs.deny which is part of crontabs(4).

EXAMPLE

This example shows how to set up the behaviour similar to previous setting in /etc/crontab which will start all regular jobs only between 6:00 and 8:00. There is added RANDOM_DELAY which will be maximally 30 minutes. Jobs will be running in queue. After one finish, then next will start.
 # environment variables
 SHELL=/bin/sh
 PATH=/sbin:/bin:/usr/sbin:/usr/bin
 MAILTO=root
 RANDOM_DELAY=30
 # Anacron jobs will start between 6 and 8 o'clock.
 START_HOURS_RANGE=6-8
 # delay will be 5 minutes + RANDOM_DELAY for cron.daily
 1               0       cron.daily              nice run-parts /etc/cron.daily
 7               0       cron.weekly             nice run-parts /etc/cron.weekly
 @monthly        0       cron.monthly            nice run-parts /etc/cron.monthly
 

SEE ALSO

anacron(8), crontabs(4)

The Anacron README file.

AUTHOR

Itai Tzur <itzur@actcom.co.il>

Currently maintained by Pascal Hakim <pasc@(debian.org|redellipse.net)>.

For Fedora maintained by Marcela Mašláňová <mmaslano@redhat.com>.