I added a file to my cron.hourly folder. It runs every hour but it runs 17 min past the hour. So instead of running at 5:00, it runs at 5:17. How can I change the cron.hourly or reset it to exact hours.
2 Answers
The hourly cron is triggered by another cron entry. I FC28 I have /etc/cron.d/0hourly:
# Run the hourly jobs
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
01 * * * * root run-parts /etc/cron.hourly
On other linux distros it might be slightly different and could be in another cron file.
-
1This can often be confirmed by watching
/var/log/cron
, and looking for the messages which say things like(run-parts /etc/cron.hourly)
. Sep 13, 2018 at 22:15 -
sorry for sounding like a novice, how do I watch /var/log/cron? Sep 13, 2018 at 22:45
-
That depends on how the hourly cron is configured ...
- Most conventional is that cron.hourly is scheduled from the
/etc/crontab
configuration file - Systemd also supports cron timers which can replace the conventional cron daemon
- And don’t forget that scripts/jobs in /etc/cron.d
And keep in mind that scripts in /etc/cron.hourly run sequentially in lexicographical order and if a-script
starts on the hour and takes 17 minutes then b-script
will start only 17 minutes past the hour