View Full Version : Cron Job Help

February 27th, 2007, 04:26 PM

At my work the guy that previously held my position made a cron job that seems to run every two hours. However, when you look at the cron tab entry it shows:

"0 * * * * rsync..."

Which should run every hour. Any suggestions as to why it would only run every other hour?

Thank you ahead of time,

February 27th, 2007, 04:36 PM
what if you tried this:

0 0-23 * * * rsync...

February 27th, 2007, 04:52 PM
It's actually ok that it is running every other hour, I am just trying to understand why it has this behavior since the crontab entry is showing that it should run every hour. Thank you for your suggestion though.

February 27th, 2007, 05:30 PM
i don't know what to tell you. Your command is correct. Crontab is just a weird thing. I had a problem one time where it would only run a command for a set time (about 15 minutes) when it was supposed to run for 3 hours. Eventually it just started working right, without me changing anything.

maybe try restarting your computer?

February 27th, 2007, 06:07 PM
Try: 1 * * * *

February 27th, 2007, 09:00 PM
for hourly jobs, you can simply put the script in the /etc/cron.hourly/ folder.

crontab works ok, but i think you'll need to restart the con deamon after changes.

February 27th, 2007, 10:05 PM
Well it turns out that it was running every hour, the person who was receiving the hourly e-mails that it sent missed one so he told me that it was doing it only every other hour when it was working correctly. :lolflag: Thank you to everyone who helped me out!!