The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Timing of cron jobs are wrong

Discussion in 'General Discussion' started by jsteel, Sep 17, 2003.

  1. jsteel

    jsteel Well-Known Member

    Joined:
    Jul 4, 2002
    Messages:
    646
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    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:
     
  2. WebmastTroy

    WebmastTroy Well-Known Member

    Joined:
    Apr 28, 2002
    Messages:
    85
    Likes Received:
    0
    Trophy Points:
    6
    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.
     
    #2 WebmastTroy, Sep 17, 2003
    Last edited: Sep 17, 2003
  3. jsteel

    jsteel Well-Known Member

    Joined:
    Jul 4, 2002
    Messages:
    646
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    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:
     
  4. jsteel

    jsteel Well-Known Member

    Joined:
    Jul 4, 2002
    Messages:
    646
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    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:
     
  5. jsteel

    jsteel Well-Known Member

    Joined:
    Jul 4, 2002
    Messages:
    646
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    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:
     
  6. CoolMike

    CoolMike Well-Known Member

    Joined:
    Sep 6, 2001
    Messages:
    307
    Likes Received:
    0
    Trophy Points:
    16
    Hi

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

    Thanks
    Michael

    cPanel.net Support Ticket Number:
     
  7. Priest

    Priest Registered

    Joined:
    Jul 31, 2003
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    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-
     
  8. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    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.
     
  9. pcsmith_uk

    pcsmith_uk Registered

    Joined:
    Aug 27, 2003
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    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 :)
     
    #9 pcsmith_uk, Nov 24, 2003
    Last edited: Nov 24, 2003
  10. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    ON, Canada
    Thanks. It fixed it for me. :)
     
Loading...

Share This Page