Name

anacron

Synopsis

anacron [options] [job]

System administration command. Normally started in a system startup file. Execute commands periodically. By default, anacron reads a list of jobs from a configuration file, /etc/anacrontab. The file consists of shell variables to use when running commands, followed by a list of tasks to run. Each task specifies how often in days it should be run, a delay in minutes to wait before running the task, a unique job identifier used to store a timestamp, and the shell command to execute. Timestamps for the last run of each task are stored in the /var/spool/anacron file. For each task, anacron compares the stored timestamp against the current time. If the command has not been executed within the specified frequency, the command is run. Upon completion, anacron records the new date in the timestamp file. Limit anacron to a specified task by providing the task’s unique job identifier on the command line.

The anacron command is often used to support the cron daemon on systems that do not run continuously.

Options

-d

Run in foreground rather than as a background process. Send messages to standard error.

-f

Run tasks ignoring timestamps.

-h

Print help message, then exit.

-n

Run tasks now, ignoring delay specifications.

-q

Suppress messages to standard error when using the -d option.

-s

Execute tasks serially. Do not start new task until previous task is completed.

-S directory

Store timestamps in directory instead of /var/spool/anacron.

-t file

Read tasks from file

Get Linux in a Nutshell, 6th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.