Timing of cron jobs are wrong

jsteel

Well-Known Member
Jul 4, 2002
646
0
166
Atlanta, GA
I have used WHM to configure the server time to the GMT timezone. Executing 'date' fromt he shell confirms is it on GMT. I have configured some cron jobs to run at 4am, but they run at 8am. Any ideas?

I sure hope it is something stupid as I am absolutely baffled by this.

cPanel.net Support Ticket Number:
 

WebmastTroy

Well-Known Member
Apr 28, 2002
85
0
306
do 'hwclock' in shell

<EDIT>
(Figured I'd answer the problem also)
You should notice that the time that shows up goes along with what the cron job is trying to do. Run:

hwclock --systohc

and you're set.
 
Last edited:

jsteel

Well-Known Member
Jul 4, 2002
646
0
166
Atlanta, GA
ok. I see that for some reason the hardware clock thinks it is 2:12am GMT , when in fact it is currently 2:12am EDT.

Will the command you note adjust the system clock to be the correct time GMT or is it going to make my sysclock adjust to the time of the hardware clock? Or is this going to be a two fold process, 1) using your command to sync things and 2) then adjust the system time to be the correct time GMT?

TIA.

cPanel.net Support Ticket Number:
 

jsteel

Well-Known Member
Jul 4, 2002
646
0
166
Atlanta, GA
Nevermind. Went ahead and ran the command now that today's crons have run and all looks good on the sync. We'll just wait to see if the crons runs at the correct time tonight (we're sure they will).

Thanks again.

cPanel.net Support Ticket Number:
 

jsteel

Well-Known Member
Jul 4, 2002
646
0
166
Atlanta, GA
Guess I was wrong. Now I'm absolutely, positively insane. We have 24 servers and only one is having this problem.

At 12:01am EDT, I execute the follow on the server in question (which is set to GMT time for our European customers):

COMMAND: date
RESULT: 04:01 GMT

Okay, looks good.

COMMAND: hwclock
RESULT: 04:01 GMT

Okay looks really good, however, my cron job set for:

00 04 * * * executable

is not running until 8:00 GMT.

Can anyone end this insanity?

cPanel.net Support Ticket Number:
 

CoolMike

Well-Known Member
Sep 6, 2001
309
0
316
Hi

I have exactly the same problem, have you found a solution?

Thanks
Michael

cPanel.net Support Ticket Number:
 

Priest

Registered
Jul 31, 2003
4
0
151
New York City
Same problem here.

Through WHM, my server time is set correctly but all my cron jobs are running 1 hour off. Ex. I have a cron setup for midnight every night and instead it runs at 1:00am.

Could this maybe have been a problem with Daylight Savings Time?

Any way to fix this would be great. It's a huge annoyance!

-p-
 

PWSowner

Well-Known Member
Nov 10, 2001
2,948
4
343
ON, Canada
Can't be daylight savings time cause my cron jobs are off by 2 hours. My server is set to my time zone and my time, but I have to set my cron jobs to run 2 hours early to have them run when I want them to.
 

pcsmith_uk

Registered
Aug 27, 2003
4
0
151
I have exactly the same problem, hardware clock and server clock are GMT, cron job set to run at midnight runs at 6am GMT instead. I really don't want to have to resort to changing my cron to run at 6pm (and hence have it run at midnight) if I can avoid it.

Any help greatly appreciated.

System is Red Hat 7.3, cpanel ver is 8.5.4-RELEASE 7

All cron jobs are running 6 hours late, even the cPanel auto update :confused:



<EDIT>
I just found on another forum an answer to my problem, hopefully it will fix your problems too.

Logged in as root I simply restarted the cron service after setting the system and hardware clocks

service crond restart

Now all my cron jobs are running at the correct time :)
 
Last edited: