Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

This question came up over in Root Access.

Why does the default /etc/crontab not check for existence (and executable flag) of /usr/sbin/anacron for the hourly entry?

My /etc/crontab:

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

What makes hourly different from the others?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

anacron is running on a daily basis. It is not built to let jobs run on a hourly basis, so it is useless to test for anacron when an hourly job is started. To quote anacron(8):

Anacron can be used to execute commands periodically, with a frequency specified in days. Unlike cron(8), it does not assume that the machine is running continuously. Hence, it can be used on machines that aren't running 24 hours a day, to control daily, weekly, and monthly jobs that are usually controlled by cron.

The other regularly executed jobs should only be executed by cron, when anacron is not installed.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.