Anacron reads a list of jobs from the /etc/anacrontab configuration file (see anacrontab(5)). This file contains the list of jobs that Anacron controls. Each job entry specifies a period in days, a delay in minutes, a unique job identifier, and a shell command.
For each job, Anacron checks whether this job has been executed in the last n days, where n is the time period specified for that job. If a job has not been executed in n days or more, Anacron runs the job's shell command, after waiting for the number of minutes specified as the delay parameter.
After the command exits, Anacron records the date (excludes the hour) in a special timestamp file for that job, so it knows when to execute that job again.
When there are no more jobs to be run, Anacron exits.
Anacron only considers jobs whose identifier, as specified in anacrontab(5), matches any of the job command-line arguments. The job command-line arguments can be represented by shell wildcard patterns (be sure to protect them from your shell with adequate quoting). Specifying no job command-line arguments is equivalent to specifying "*" (that is, all jobs are considered by Anacron).
Unless Anacron is run with the -d option (specified below), it forks to the background when it starts, and any parent processes exit immediately.
Unless Anacron is run with the -s or -n options, it starts jobs immediately when their delay is over. The execution of different jobs is completely independent.
If an executed job generates any output to standard output or to standard error, the output is mailed to the user under whom Anacron is running (usually root), or to the address specified in the MAILTO environment variable in the /etc/anacrontab file, if such exists. If the LOGNAME environment variable is set, it is used in the From: field of the mail.
Any informative messages generated by Anacron are sent to syslogd(8) or rsyslogd(8) under with facility set to cron and priority set to notice. Any error messages are sent with the priority error.
"Active" jobs (i.e., jobs that Anacron already decided to run and are now waiting for their delay to pass, and jobs that are currently being executed by Anacron), are "locked", so that other copies of Anacron cannot run them at the same time.
Timestamp files are created in the spool directory for each job specified in an anacrontab. These files are never removed automatically by Anacron, and should be removed by hand if a job is no longer being scheduled.
Anacron uses up to two file descriptors for each active job. It may run out of descriptors if there are lots of active jobs. See echo $(($(ulimit -n) / 2)) for information how many concurent jobs anacron may run.
Mail comments, suggestions and bug reports to Sean 'Shaleh' Perry
The current implementation is a complete rewrite by Itai Tzur
The code base was maintained by Sean 'Shaleh' Perry
Since 2004, it is maintained by Pascal Hakim
For Fedora, Anacron is maintained by Marcela Mašláňová