anacron
用于不能全天候开机的电脑,替代完成 cron
命令的守护进程。由于常规的计划任务通常被安排在午夜执行,如果计算机当时没有开机就不会运行这些任务。 anacron
的目的就在于运行这些计划任务,并考虑计算机关机时间。
请注意, anacron
会在启动机器之后,频频执行此类活动,有可能导致计算机反应迟缓。这也正是/etc/anacrontab
文件中的任务以 nice
命令开头的原因,这样可以减小它们执行优先级进而限制它们对系统的影响。注意,该文件的格式和 /etc/crontab
不完全相同;如果对 anacron
有特殊需求设定,可参看 anacrontab(5) 手册。
Installation of the anacron package deactivates execution by cron
of the scripts in the /etc/cron.hourly/
, /etc/cron.daily/
, /etc/cron.weekly/
, and /etc/cron.monthly/
directories. This avoids their double execution by anacron
and cron
. The latter command remains active, though, and will continue to handle the other scheduled tasks (especially those scheduled by users).