Who runs scripts inside /etc/cron.hourly if anacron is enabled?
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.
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.