1ANACRONTAB(5) File Formats ANACRONTAB(5)
2
3
4
6 /etc/anacrontab - configuration file for Anacron
7
9 The /etc/anacrontab configuration file describes the jobs controlled by
10 anacron(8). It can contain three types of lines: job-description
11 lines, environment assignments, or empty lines.
12
13 Job-description lines can have the following format:
14
15 period in days delay in minutes job-identifier command
16
17 The period in days variable specifies the frequency of execution of a
18 job in days. This variable can be represented by an integer or a macro
19 (@daily, @weekly, @monthly), where @daily denotes the same value as the
20 integer 1, @weekly the same as 7, and @monthly specifies that the job
21 is run once a month, independent on the length of the month.
22
23 The delay in minutes variable specifies the number of minutes anacron
24 waits, if necessary, before executing a job. This variable is repre‐
25 sented by an integer where 0 means no delay.
26
27 The job-identifier variable specifies a unique name of a job which is
28 used in the log files.
29
30 The command variable specifies the command to execute. The command can
31 either be a command such as ls /proc >> /tmp/proc or a command to exe‐
32 cute a custom script.
33
34 Environment assignment lines can have the following format:
35
36 VAR=VALUE
37
38 Any spaces around VAR are removed. No spaces around VALUE are allowed
39 (unless you want them to be part of the value). The specified assign‐
40 ment takes effect from the next line until the end of the file, or to
41 the next assignment of the same variable.
42
43 The START_HOURS_RANGE variable defines an interval (in hours) when
44 scheduled jobs can be run. In case this time interval is missed, for
45 example, due to a power down, then scheduled jobs are not executed that
46 day.
47
48 The RANDOM_DELAY variable denotes the maximum number of minutes that
49 will be added to the delay in minutes variable which is specified for
50 each job. A RANDOM_DELAY set to 12 would therefore add, randomly,
51 between 0 and 12 minutes to the delay in minutes for each job in that
52 particular anacrontab. When set to 0, no random delay is added.
53
54 If MAILTO is defined (and non-empty), mail is sent to the specified
55 address, otherwise, system user is used.
56
57 If MAILFROM is defined (and non-empty), it is used as the envelope
58 sender address, otherwise, system user is used.
59
60 (Note: Both MAILFROM and MAILTO variables are expanded, so setting them
61 as in the following example works as expected: MAIL‐
62 FROM=cron-$USER@cron.com ($USER is replaced by the system user) )
63
64 Empty lines are either blank lines, line containing white spaces only,
65 or lines with white spaces followed by a '#' followed by an arbitrary
66 comment.
67
68 You can continue a line onto the next line by adding a '\' at the end
69 of it.
70
71 In case you want to disable Anacron, add a line with 0anacron which is
72 the name of the script running the Anacron into the
73 /etc/cron.hourly/jobs.deny file.
74
76 This example shows how to set up an Anacron job similar in functional‐
77 ity to /etc/crontab which starts all regular jobs between 6:00 and 8:00
78 only. A RANDOM_DELAY which can be 30 minutes at the most is specified.
79 Jobs will run serialized in a queue where each job is started only
80 after the previous one is finished.
81
82 # environment variables
83 SHELL=/bin/sh
84 PATH=/sbin:/bin:/usr/sbin:/usr/bin
85 MAILTO=root
86 RANDOM_DELAY=30
87 # Anacron jobs will start between 6am and 8am.
88 START_HOURS_RANGE=6-8
89 # delay will be 5 minutes + RANDOM_DELAY for cron.daily
90 1 5 cron.daily nice run-parts /etc/cron.daily
91 7 0 cron.weekly nice run-parts /etc/cron.weekly
92 @monthly 0 cron.monthly nice run-parts /etc/cron.monthly
93
95 anacron(8), crontab(1)
96
97 The Anacron README file.
98
100 Itai Tzur ⟨itzur@actcom.co.il⟩
101
102 Currently maintained by Pascal Hakim ⟨pasc@(debian.org|redellipse.
103 net)⟩.
104
105 For Fedora, maintained by Marcela Mašláňová ⟨mmaslano@redhat.com⟩.
106
107
108
109cronie 2012-11-22 ANACRONTAB(5)