-1

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.

1
  • What does your configuration look like? What OS and version are you running?
    – Tommiie
    Dec 13, 2018 at 10:20

2 Answers 2

3

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.

3
  • 1
    This 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
  • tail -n 100 -f /var/log/cron. Location is also distro dependent
    – danblack
    Sep 13, 2018 at 22:50
2

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .