1ANACRON(8) Anacron Users' Manual ANACRON(8)
2
3
4
6 anacron - runs commands periodically
7
9 anacron [-s] [-f] [-n] [-d] [-q] [-t anacrontab] [-S spooldir] [job]
10 anacron [-S spooldir] -u [-t anacrontab] [job]
11 anacron [-V|-h]
12 anacron -T [-t anacrontab]
13
15 Anacron is used to execute commands periodically, with a frequency
16 specified in days. Unlike cron(8), it does not assume that the machine
17 is running continuously. Hence, it can be used on machines that aren't
18 running 24 hours a day, to control regular jobs as daily, weekly, and
19 monthly jobs.
20
21 Anacron reads a list of jobs from a configuration file, /etc/anacrontab
22 (see anacrontab(5)). This file contains the list of jobs that Anacron
23 controls. Each job entry specifies a period in days, a delay in min‐
24 utes, a unique job identifier, and a shell command.
25
26 For each job, Anacron checks whether this job has been executed in the
27 last n days, where n is the period specified for that job. If not,
28 Anacron runs the job's shell command, after waiting for the number of
29 minutes specified as the delay parameter.
30
31 After the command exits, Anacron records the date in a special time‐
32 stamp file for that job, so it can know when to execute it again. Only
33 the date is used for the time calculations. The hour is not used.
34
35 When there are no more jobs to be run, Anacron exits.
36
37 Anacron only considers jobs whose identifier, as specified in the
38 anacrontab matches any of the job command-line arguments. The job
39 arguments can be shell wildcard patterns (be sure to protect them from
40 your shell with adequate quoting). Specifying no job arguments, is
41 equivalent to specifying "*" (That is, all jobs will be considered).
42
43 Unless the -d option is given (see below), Anacron forks to the back‐
44 ground when it starts, and the parent process exits immediately.
45
46 Unless the -s or -n options are given, Anacron starts jobs immediately
47 when their delay is over. The execution of different jobs is com‐
48 pletely independent.
49
50 If a job generates any output on its standard output or standard error,
51 the output is mailed to the user running Anacron (usually root), or to
52 the address contained by the MAILTO environment variable in the
53 crontab, if such exists. If the LOGNAME environment variable is set, it
54 will be used as From: field.
55
56 Informative messages about what Anacron is doing are sent to syslogd(8)
57 or rsyslogd(8) under facility cron, priority notice. Error messages
58 are sent at priority error.
59
60 "Active" jobs (i.e. jobs that Anacron already decided to run and now
61 wait for their delay to pass, and jobs that are currently being exe‐
62 cuted by Anacron), are "locked", so that other copies of Anacron won't
63 run them at the same time.
64
66 -f Force execution of the jobs, ignoring the timestamps.
67
68 -u Only update the timestamps of the jobs, to the current date, but
69 don't run anything.
70
71 -s Serialize execution of jobs. Anacron will not start a new job
72 before the previous one finished.
73
74 -n Run jobs now. Ignore the delay specifications in the
75 /etc/anacrontab file. This options implies -s.
76
77 -d Don't fork to the background. In this mode, Anacron will output
78 informational messages to standard error, as well as to syslog.
79 The output of jobs is mailed as usual.
80
81 -q Suppress messages to standard error. Only applicable with -d.
82
83 -t some_anacrontab
84 Use specified anacrontab, rather than the default
85
86 -T Anacrontab testing. The configuration file will be tested for
87 validity. If there is an error in the file, an error will be
88 shown and anacron will return 1. Valid anacrontabs will return
89 0.
90
91 -S spooldir
92 Use the specified spooldir to store timestamps in. This option
93 is required for users who wish to run anacron themselves.
94
95 -V Print version information, and exit.
96
97 -h Print short usage message, and exit.
98
100 After receiving a SIGUSR1 signal, Anacron waits for running jobs, if
101 any, to finish and then exits. This can be used to stop Anacron
102 cleanly.
103
105 Make sure that the time-zone is set correctly before Anacron is
106 started. (The time-zone affects the date). This is usually accom‐
107 plished by setting the TZ environment variable, or by installing a
108 /usr/lib/zoneinfo/localtime file. See tzset(3) for more information.
109
110 Timestamp files are created in the spool directory for each job in
111 anacrontab. These are never removed automatically by anacron, and
112 should be removed by hand if a job is no longer being scheduled.
113
115 /etc/anacrontab
116 Contains specifications of jobs. See anacrontab(5) for a com‐
117 plete description.
118
119 /var/spool/anacron
120 This directory is used by Anacron for storing timestamp files.
121
123 anacrontab(5),cron(8),tzset(3)
124
125 The Anacron README file.
126
128 Anacron never removes timestamp files. Remove unused files manually.
129
130 Anacron uses up to two file descriptors for each active job. It may
131 run out of descriptors if there are more than about 125 active jobs (on
132 normal kernels).
133
134 Mail comments, suggestions and bug reports to Sean 'Shaleh' Perry
135 <shaleh@(debian.org|valinux.com)>.
136
138 Anacron was originally conceived and implemented by Christian Schwarz
139 <schwarz@monet.m.isar.de>.
140
141 The current implementation is a complete rewrite by Itai Tzur
142 <itzur@actcom.co.il>.
143
144 The code base was maintained by Sean 'Shaleh' Perry
145 <shaleh@(debian.org|valinux.com)>.
146
147 Since 2004, it is maintained by Pascal Hakim <pasc@(debian.org|redel‐
148 lipse.net)>.
149
150 For Fedora is anacron maintained by Marcela Mašláňová <mmaslano@red‐
151 hat.com>.
152
153
154
155Marcela Mašláňová 2009-07-17 ANACRON(8)