ANACRON(8)
๐
ANACRON(8) โ the anacron glow-up (manual page, section 8, system administration era)
okay so bestie, welcome to ANACRON(8), the page about anacron โ the cron-adjacent icon that runs commands periodically. she's lowkey the main character of "my laptop isn't on 24/7" representation. let's get into it โจ
๐ธ NAME ๐ธ
anacron โ runs commands periodically. that's it, that's the vibe. she runs things on a schedule and she does not need your machine to be awake the whole time. periodt.
๐ SYNOPSIS ๐
anacron [-s] [-f] [-n] [-d] [-q] [-t anacrontab] [-S spooldir] [job]
anacron [-S spooldir] -u [-t anacrontab] [job]
anacron [-V|-h]
anacron -T [-t anacrontab]
four whole moods, bestie. pick your fighter ๐
๐ DESCRIPTION ๐
so <pink>Anacron</pink> is used to execute commands periodically, with a frequency specified in <purple>days</purple>. and here's the iconic part: unlike cron(8), it does not assume that the machine is running continuously. no cap. that means it's literally built for machines that are not running 24 hours a day, to control regular jobs as daily, weekly, and monthly jobs. laptops everywhere are screaming with joy ๐ญ๐
Anacron reads a list of jobs from the /etc/anacrontab configuration file (see anacrontab(5)). that file contains the list of jobs that Anacron controls. each job entry specifies a <lavender>period in days</lavender>, a <lavender>delay in minutes</lavender>, a <lavender>unique job identifier</lavender>, and a <lavender>shell command</lavender>. all four. no skimping.
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 โ but only after waiting for the number of minutes specified as the delay parameter. she's punctual and polite ๐ซถ
after the command exits, Anacron records the date (excludes the hour โ yes, the hour is simply not invited) in a special timestamp file for that job, so it knows when to execute that job again. very "i remember everything" of her tbh ๐ฆ
when there are no more jobs to be run, Anacron exits. she leaves. she's done. goodbye. ๐
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 <cyan>shell wildcard patterns</cyan> โ and bestie, be sure to protect them from your shell with adequate quoting. your shell will absolutely eat them otherwise, and then you'll be sad ๐
specifying no job command-line arguments is equivalent to specifying "*" (that is, all jobs are considered by Anacron). so no args = everyone's invited to the function.
unless Anacron is run with the -d option (specified below ๐), it forks to the background when it starts, and any parent processes exit immediately. she's out of there. nothing personal.
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. they don't know each other. they don't talk. independent queens โจ
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. she's forwarding your mess to your inbox, respectfully ๐ฌ
any informative messages generated by Anacron are sent to syslogd(8) or rsyslogd(8) with facility set to cron and priority set to notice. any error messages are sent with the priority error. so when things go bad, syslog hears about it in the group chat too.
"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 <hotpink>"locked"</hotpink>, so that other copies of Anacron cannot run them at the same time. no double-booking in this house. the lock is giving bouncer at the club ๐ง
โจ OPTIONS โจ
-fโ Forces execution of all jobs, ignoring any timestamps. timestamps? never heard of her. go go go ๐ฅ-uโ Updates the timestamps of all jobs to the current date, but does not run any. all the paperwork, none of the work. iconic.-sโ Serializes execution of jobs. Anacron does not start a new job before the previous one finished. one at a time, we wait our turn ๐-nโ Runs jobs immediately and ignores the specified delays in the/etc/anacrontabfile. this option implies-s. yes, delays are cancelled, and also yes, it's serial now.-dโ Does not fork Anacron to the background. in this mode, Anacron will output informational messages to standard error, as well as to syslog. the output of any job is mailed by Anacron. she stays. she narrates. she emails.-qโ Suppresses any messages to standard error. only applicable with-d. quiet mode, but only if you're already in-dmode. iykyk-tsome_anacrontab โ Uses the specified some_anacrontab, rather than the/etc/anacrontabdefault one. bring your own config, bestie ๐-Tโ Anacrontab testing. Tests the/etc/anacrontabconfiguration file for validity. if there is an error in the file, it is shown on the standard output and Anacron returns the value of1. valid anacrontabs return the value of0. vibe check for your config ๐-Sspooldir โ Uses the specified spooldir to store timestamps in. this option is required for users who wish to run anacron themselves. like, actually required. don't skip it ๐ซถ-Vโ Prints version information, and exits. hello, i am version, goodbye.-hโ Prints short usage message, and exits. the tl;dr of the whole page.
โญ SIGNALS โญ
after receiving a SIGUSR1 signal, Anacron waits for any running jobs to finish and then exits. this can be used to stop Anacron cleanly. she's not gonna ghost mid-job โ she finishes her sentence first, then leaves. ladies leave cleanly ๐
๐ NOTES ๐
make sure your <yellow>time-zone</yellow> is set correctly before Anacron is started, since the time-zone affects the date. this is usually accomplished by setting the TZ environment variable, or by installing a /usr/lib/zoneinfo/localtime file. see tzset(3) for more information. wrong timezone = wrong date = chaos, and not the fun kind ๐ญ
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. yes, by hand. yes, you. ๐
๐ฆ FILES ๐ฆ
/etc/anacrontabโ contains specifications of jobs. seeanacrontab(5)for a complete description./var/spool/anacronโ this directory is used by Anacron for storing timestamp files.
๐ SEE ALSO ๐
anacrontab(5), cron(8), tzset(3)
the Anacron README file. yes, the README. she said read it ๐
๐ BUGS ๐
- Anacron never removes timestamp files. remove unused files manually. she will keep them forever, like screenshots from 2019.
- Anacron uses up to
<red>two file descriptors</red>for each active job. it may run out of descriptors if there are lots of active jobs. seeecho $(($(ulimit -n) / 2))for information how many concurrent jobs anacron may run. do the math, bestie ๐งฎ - mail comments, suggestions and bug reports to Sean 'Shaleh' Perry.
๐ธ AUTHOR ๐ธ
- Anacron was originally conceived and implemented by Christian Schwarz.
- 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รก.
and that's the page, bestie ๐โจ this whole thing is cronie, dated 2012-11-22, and it's the ANACRON(8) manual โ go forth, schedule responsibly, and remember: she never deletes her timestamp files ๐
๐
๐ฆ 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