ANACRONTAB(5)
๐
ANACRONTAB(5) โ /etc/anacrontab, from File Formats, bestie ๐
๐ธ NAME ๐ธ
Bestie, /etc/anacrontab is literally the configuration file for Anacron. It describes the jobs controlled by anacron(8). It can contain three types of lines: job-description lines, environment assignments, or empty lines. periodt โจ
โจ DESCRIPTION โจ
okay so job-description lines can have this exact format:
period in days delay in minutes job-identifier command
- The
period in daysvariable specifies the frequency of execution of a job in days. This variable can be represented by an integer or a macro (@daily,@weekly,@monthly), where@dailydenotes the same value as the integer1,@weeklythe same as7, and@monthlyspecifies that the job is run once a month, independent on the length of the month. ๐๏ธ - The
delay in minutesvariable specifies the number of minutes anacron waits, if necessary, before executing a job. This variable is represented by an integer where0means no delay. โณ - The
job-identifiervariable specifies a unique name of a job which is used in the log files. ๐ท๏ธ - The
commandvariable specifies the command to execute. The command can either be a command such asls /proc >> /tmp/procor a command to execute a custom script. ๐ป
Environment assignment lines can have this exact format:
VAR=VALUE
Any spaces around VAR are removed. No spaces around VALUE are allowed (unless you want them to be part of the value). The specified assignment takes effect from the next line until the end of the file, or to the next assignment of the same variable. iykyk ๐ซถ
START_HOURS_RANGEdefines an interval (in hours) when scheduled jobs can be run. In case this time interval is missed, for example, due to a power down, then scheduled jobs are not executed that day. โกRANDOM_DELAYdenotes the maximum number of minutes that will be added to thedelay in minutesvariable which is specified for each job. ARANDOM_DELAYset to12would therefore add, randomly, between0and12minutes to thedelay in minutesfor each job in that particular anacrontab. When set to0, no random delay is added. ๐ฒ- If
MAILTOis defined (and non-empty), mail is sent to the specified address, otherwise, system user is used. ๐ฌ - If
MAILFROMis defined (and non-empty), it is used as the envelope sender address, otherwise, system user is used. ๐ฎ - If
NO_MAIL_OUTPUTis defined (and non-empty), the standard output and error descriptors of job processes are not redirected and e-mailed. ๐
(Note: Both MAILFROM and MAILTO variables are expanded, so setting them as in the following example works as expected:
MAILFROM=cron-$USER@cron.com
$USER is replaced by the system user.)
Empty lines are either blank lines, line containing white spaces only, or lines with white spaces followed by a '#' followed by an arbitrary comment. ๐ง
You can continue a line onto the next line by adding a \ at the end of it. ๐
๐จ In case you want to disable Anacron, add a line with0anacronwhich is the name of the script running the Anacron into the/etc/cron.hourly/jobs.denyfile.
๐ EXAMPLE ๐
This example shows how to set up an Anacron job similar in functionality to /etc/crontab which starts all regular jobs between 6:00 and 8:00 only. A RANDOM_DELAY which can be 30 minutes at the most is specified. Jobs will run serialized in a queue where each job is started only after the previous one is finished. ๐
# environment variables
SHELL=/bin/sh
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
RANDOM_DELAY=30
# Anacron jobs will start between 6am and 8am.
START_HOURS_RANGE=6-8
# delay will be 5 minutes + RANDOM_DELAY for cron.daily
1 5 cron.daily nice run-parts /etc/cron.daily
7 0 cron.weekly nice run-parts /etc/cron.weekly
@monthly 0 cron.monthly nice run-parts /etc/cron.monthly
๐ฆ SEE ALSO ๐ฆ
anacron(8),crontab(1)- The Anacron README file. ๐
๐ AUTHOR ๐
Itai Tzur
Currently maintained by Pascal Hakim.
For Fedora, maintained by Marcela Maลกlรกลovรก. ๐ธ
๐ xoxo bestie โ source/version: cronie; date: 2012-11-22; manual: ANACRONTAB(5) ๐
๐ฆ where this page comes from
- alpine 3.24: cronie-doc 1.7.2-r1 ยท ISC
- arch rolling: cronie 1.7.2-2 ยท custom:BSD
- centos-stream 10: cronie-anacron 1.7.0-15.el10 ยท GPL-2.0-or-later AND BSD-3-Clause AND BSD-2-Clause AND ISC AND LGPL-2.1-or-later
- fedora 43: cronie-anacron 1.7.2-12.fc43 ยท GPL-2.0-or-later AND BSD-3-Clause AND BSD-2-Clause AND ISC AND LGPL-2.1-or-later
- fedora 44: cronie-anacron 1.7.2-16.fc44 ยท GPL-2.0-or-later AND BSD-3-Clause AND BSD-2-Clause AND ISC AND LGPL-2.1-or-later
- nixpkgs unstable: cronie 1.7.2
- opensuse-leap 16.0: cronie-anacron 1.7.2-160000.2.2 ยท BSD-3-Clause AND GPL-2.0-only AND MIT
- opensuse-leap 16.0: cronie-anacron 1.7.2-160000.2.2 ยท BSD-3-Clause AND GPL-2.0-only AND MIT
- opensuse-leap 16.0: cronie-anacron 1.7.2-160000.2.2 ยท BSD-3-Clause AND GPL-2.0-only AND MIT
- opensuse-leap 16.0: cronie-anacron 1.7.2-160000.2.2 ยท BSD-3-Clause AND GPL-2.0-only AND MIT
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms