5

I've read that if anacron is enabled cron doesn't run the scripts inside cron.weekly/hourly/daily/hourly, as not to run them twice. So anacron takes responsability on that folders.

However anacron doesn't work with hourly scripts. So, who runs /etc/cron.hourly?

Sorry if it is a begginer question.

whitenoisedb
  • 733
  • 4
  • 12
  • 18

1 Answers1

8

If you look at /etc/crontab, you'll see:

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 )

Then check the status of cron:

$ service cron status
cron start/running, process 1041

anacron itself doesn't run as a service/daemon, but as a cron job: /etc/cron.d/anacron. So cron is running and checking if anacron is present for the daily, weekly and monthly tasks, but not for the hourly tasks. cron runs the hourly tasks.

muru
  • 197,895
  • 55
  • 485
  • 740
  • 1
    off topic: is there a reason to choose [any-hour]:17 minutes, any day at 6:25, etc, instead of doing them at :00 o' clock? – whitenoisedb Sep 02 '14 at 06:06
  • 2
    @redraw Not off topic :) See http://askubuntu.com/questions/149490/what-is-the-story-behind-the-default-times-set-in-etc-crontab – muru Sep 02 '14 at 06:51