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 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.

1 Answer

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.

2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like