1ANACRON(8)                   System Administration                  ANACRON(8)
2
3
4

NAME

6       anacron - runs commands periodically
7

SYNOPSIS

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

DESCRIPTION

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 are
18       not running 24 hours a day to control regular jobs  as  daily,  weekly,
19       and monthly jobs.
20
21       Anacron  reads  a  list  of jobs from the /etc/anacrontab configuration
22       file (see anacrontab(5)).  This file contains the  list  of  jobs  that
23       Anacron  controls.   Each job entry specifies a period in days, a delay
24       in minutes, 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 time period specified for that job.  If a
28       job has not been executed in n days or more,  Anacron  runs  the  job's
29       shell command, after waiting for the number of minutes specified as the
30       delay parameter.
31
32       After the command exits, Anacron records the date (excludes  the  hour)
33       in  a  special timestamp file for that job, so it knows when to execute
34       that job again.
35
36       When there are no more jobs to be run, Anacron exits.
37
38       Anacron  only  considers  jobs  whose  identifier,  as   specified   in
39       anacrontab(5),  matches any of the job command-line arguments.  The job
40       command-line arguments can be represented by  shell  wildcard  patterns
41       (be sure to protect them from your shell with adequate quoting).  Spec‐
42       ifying no job command-line arguments is equivalent  to  specifying  "*"
43       (that is, all jobs are considered by Anacron).
44
45       Unless Anacron is run with the -d option (specified below), it forks to
46       the background when it starts, and any parent  processes  exit  immedi‐
47       ately.
48
49       Unless Anacron is run with the -s or -n options, it starts jobs immedi‐
50       ately when their delay is over.  The execution  of  different  jobs  is
51       completely independent.
52
53       If  an executed job generates any output to standard output or to stan‐
54       dard error, the output is mailed to the user under whom Anacron is run‐
55       ning (usually root), or to the address specified in the MAILTO environ‐
56       ment variable in the /etc/anacrontab file, if such exists.  If the LOG‐
57       NAME  environment variable is set, it is used in the From: field of the
58       mail.
59
60       Any informative messages generated by Anacron are sent to syslogd(8) or
61       rsyslogd(8) under with facility set to cron and priority set to notice.
62       Any error messages are sent with the priority error.
63
64       "Active" jobs (i.e., jobs that Anacron already decided to run  and  are
65       now  waiting for their delay to pass, and jobs that are currently being
66       executed by Anacron), are "locked", so that  other  copies  of  Anacron
67       cannot run them at the same time.
68

OPTIONS

70       -f     Forces execution of all jobs, ignoring any timestamps.
71
72       -u     Updates the timestamps of all jobs to the current date, but does
73              not run any.
74
75       -s     Serializes execution of jobs.  Anacron does not start a new  job
76              before the previous one finished.
77
78       -n     Runs  jobs  immediately  and ignores the specified delays in the
79              /etc/anacrontab file.  This options implies -s.
80
81       -d     Does not fork Anacron to the background.  In this mode,  Anacron
82              will output informational messages to standard error, as well as
83              to syslog.  The output of any job is mailed by Anacron.
84
85       -q     Suppresses any messages to standard error.  Only applicable with
86              -d.
87
88       -t some_anacrontab
89              Uses  the  specified anacrontab, rather than the /etc/anacrontab
90              default one.
91
92       -T     Anacrontab testing. Tests the /etc/anacrontab configuration file
93              for  validity.  If there is an error in the file, it is shown on
94              the standard output and Anacron returns the value of  1.   Valid
95              anacrontabs return the value of 0.
96
97       -S spooldir
98              Uses the specified spooldir to store timestamps in.  This option
99              is required for users who wish to run anacron themselves.
100
101       -V     Prints version information, and exits.
102
103       -h     Prints short usage message, and exits.
104

SIGNALS

106       After receiving a SIGUSR1 signal, Anacron waits for any running jobs to
107       finish and then exits.  This can be used to stop Anacron cleanly.
108

NOTES

110       Make  sure  your  time-zone  is set correctly before Anacron is started
111       since the time-zone affects the date.  This is usually accomplished  by
112       setting  the TZ environment variable, or by installing a /usr/lib/zone‐
113       info/localtime file.  See tzset(3) for more information.
114
115       Timestamp files are created in the spool directory for each job  speci‐
116       fied  in an anacrontab.  These files are never removed automatically by
117       Anacron, and should be removed by hand if a  job  is  no  longer  being
118       scheduled.
119

FILES

121       /etc/anacrontab
122              Contains  specifications  of jobs.  See anacrontab(5) for a com‐
123              plete description.
124
125       /var/spool/anacron
126              This directory is used by Anacron for storing timestamp files.
127

SEE ALSO

129       anacrontab(5), cron(8), tzset(3)
130
131       The Anacron README file.
132

BUGS

134       Anacron never removes timestamp files.  Remove unused files manually.
135
136       Anacron uses up to two file descriptors for each active  job.   It  may
137       run  out  of  descriptors  if  there are lots of active jobs.  See echo
138       $(($(ulimit -n) / 2)) for information how many concurent  jobs  anacron
139       may run.
140
141       Mail  comments,  suggestions  and  bug  reports  to Sean 'Shaleh' Perry
142       ⟨shaleh@(debian.org|valinux.com)⟩.
143

AUTHOR

145       Anacron was originally conceived and implemented by  Christian  Schwarz
146       ⟨schwarz@monet.m.isar.de⟩.
147
148       The  current  implementation is a complete rewrite by Itai Tzur ⟨itzur@
149       actcom.co.il⟩.
150
151       The code base was maintained by Sean  'Shaleh'  Perry  ⟨shaleh@(debian.
152       org|valinux.com)⟩.
153
154       Since  2004,  it  is  maintained  by  Pascal  Hakim  ⟨pasc@(debian.org|
155       redellipse.net)⟩.
156
157       For   Fedora,   Anacron   is   maintained    by    Marcela    Mašláňová
158       ⟨mmaslano@redhat.com⟩.
159
160
161
162cronie                            2012-11-22                        ANACRON(8)
Impressum