anacron

Toby Kelsey toby_kelsey at ntlworld.com
Tue May 9 20:41:50 UTC 2006


Derek Broughton wrote:

> Anacron exists to ensure that scheduled jobs run _sometime_.  So it runs at
> boot _and then stops_.  It also runs at set times of day (specified by
> cron) to execute the cron.*ly schedules.  If you want something to _always_
> run at an exact time, you put it in a crontab, if you want something to
> always get run, even if your system isn't up when scheduled, you use
> anacron.

Or better, use fcron, as has been suggested.

> "Description: a cron-like program that doesn't go by time" seems to be

Given the etymology and function of cron, it is a confused and
self-contradictory description.  What is cron if not a "by time" program?

The man page has a better summary "anacron - runs commands periodically"

> pretty clear that you _can't_ expect it to run at set times.  It's _not_
> advertised as a replacement for cron, either.  It's a supplement to cron -
> mostly for those of us with laptops, or desktop machines we shut down when
> not in use.

Here's the default Breezy /etc/crontab:

# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab'
# command to install the new version when you edit this file.
# This file also has a username field, that none of the other crontabs do.

SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

# m h dom mon dow user  command
17 *    * * *   root    run-parts --report /etc/cron.hourly
25 6    * * *   root    test -x /usr/sbin/anacron || run-parts --report
/etc/cron.daily
47 6    * * 7   root    test -x /usr/sbin/anacron || run-parts --report
/etc/cron.weekly
52 6    1 * *   root    test -x /usr/sbin/anacron || run-parts --report
/etc/cron.monthly
#

Clearly, when anacron is installed it _usurps_ the usual cron directories
/etc/cron.*ly.  Yes you can still edit the crontab but for the more
user-friendly directories it's not a supplement but is installed as a
replacement.  So both end-users and Ubuntu-designers are confused by its name
into thinking it's a replacement for cron.  It should be called
something different like 'periodic' and use its own directories.

Toby




More information about the ubuntu-users mailing list