Cron jobs running 6 hours late? // Fixed - cron needed restarting

I’ve set up some backups to be carried out via some cron jobs, but have noticed they are running 6 hours later.

The server time is correct, and is confirmed by ‘date’, but the cron jobs are running late - any ideas why that might be happening?

Where are you seeing the time as being 6 hours late?

Where ever it is that you’re seeing that time, is the timezone correct?

Also, you may want to look in your logs, which will show exactly when a cron job is being launched; that may offer some clues as to what’s going on.


Hi Eric

I first noticed the time when I looked at the time/date on the sql files, and also my users posted about it in our forums and noted down the exact time - which matches the time I see on the back up files (which is exactly 6 hours behind the time set in the cron-job).

Which logs do I need to look at?

If I go to Webmin > hardware > system time it is showing the correct time for both software/hardware… which is why it’s so odd :confused:

Which log files depends on your distro… what distro/version are you using there?


Hi Eric, I’m using CentOS 5.8

Okay, on CentOS, you should be able to see the Cron logs in /var/log/cron.

In there, you should see when the cron job was launched, as well as if there were any problems.

Do you see anything unusual in there?

It’s showing all crons (even the one’s that were set-up by the default install) running exactly 6 hours late.

I have set the server time to GMT (Europe/London) not sure if that has something to do with it and the cron is getting the time from somewhere else?

Running: crontab -l

Shows my correct times (last 5 lines):

2 22 * * * /etc/webmin/virtual-server/ 4,9,14,19,24,29,34,39,44,49,54,59 * * * * /etc/webmin/virtual-server/ 43 16 * * * /etc/webmin/virtual-server/ 0,5,10,15,20,25,30,35,40,45,50,55 * * * * /etc/webmin/status/ 11 * * * * /etc/webmin/virtual-server/ 47 2 * * * /home/mysite/myscripts/ 50 0 * * * /home/mysite/myscripts/ 41 2 * * * /home/mysite/myscripts/ 15 1 * * * /home/mysite/myscripts/ 30 0 * * * /home/mysite/myscripts/

But for some reason they are running 6 hours late - a really odd bug.

Edit2: I’ve read that you should restart cron after changing the sys time, so I have done that… and it seems to be working now :smiley: