logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

/etc/anacrontab — monotonic jobs

Bugs

systemd-crontab-generator doesn't support multiline commands. Any period greater than 30 is rounded to the closest month. There are subtle differences on how anacron and systemd handle persistent timers: anacron will run a weekly job at most once a week, with a guaranteed minimum delay of 6 days between runs, whereas systemd will try to run it every monday at midnight, or at system boot. In the most extreme case, if a system was booted on sunday, weekly jobs will run that day and the again the next (mon)day. There is no difference for the daily job.

Description

The file /etc/anacrontab follows the rules previously set by anacron(8). Lines starting with ‘#’ are comments. Environment variables can be set using variable=value alone on a line. The special RANDOM_DELAY (in minutes) environment variable is translated to RandomizedDelaySec=. The special START_HOURS_RANGE (in hours) environment variable is translated to the hour component of OnCalendar=. anacron expects a range in the format start-end, but systemd-crontab-generator only uses start. The other lines are job-descriptions in the white-space-separated format perioddelayjob-identifiercommand where period is a number of days to wait between each job execution, or one of the special values @reboot, @minutely, @hourly, @midnight, @daily, @weekly, @monthly, @quarterly, @semi-annually, @yearly. delay is the number of extra minutes to wait before starting job, translated to OnBootSec=, job-identifier is a single word used by systemd-crontab-generator to construct dynamic unit names in the form cron-anacron-job-identifier-MD5.{timer, service}, command is the program to run by the shell.

Diagnostics

After editing /etc/anacrontab, you can run journalctl-n and systemctllist-timers to see if the timers have well been updated.

Name

/etc/anacrontab — monotonic jobs

Notes

Real anacron only accepts @monthly and @yearly as period; all others listed above are systemd.cron(7)'s extensions. Unlike crontab(5), every anacrontab(5) job is persistent by default.

See Also

systemd.timer(5), systemd-crontab-generator(8) systemd-cron 2.5.1-2 2023-08-19 ANACRONTAB(5)

See Also