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.

Cron running one hour before scheduled...

Discussion in 'General Discussion' started by Technus007, Aug 30, 2009.

  1. Technus007

    Technus007 Member

    Joined:
    Dec 20, 2008
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    Hello!

    This seems kind of magic to me but I got upcp cron to be run at 3.00AM every day and cpbackup at 1.00AM...instead of this upcp run at 2AM, but cpbackup at 0.00AM...those cron jobs are done one hour before scheduled.

    My servers' time is correct, I don't know why is this happening.
    Maybe because of summer and winter time change (+/-1 hour) and for some reason cron running on winter time despite of servers' summer time?

    Pls assist. Thanks!
     
  2. Spiral

    Spiral BANNED

    Joined:
    Jun 24, 2005
    Messages:
    2,023
    Likes Received:
    7
    Trophy Points:
    0
    You said you think your time is correct but what about the timezone?

    Some locations don't observe daylight savings time and if you have the wrong time zone setup, you clock will actually compute things incorrectly.

    In example, Arizona, Hawaii, and Indiana don't observe DST so you if you were to select "Arizona" as your location, you may actually be an hour off schedule
    against the rest of normal Mountain Time locations.

    If both your system clock and time zone settings are in fact correct then
    the next thing I would check is to see if you possibly have another cron
    running the update someplace else at a different time than what you scheduled.

    A few commands that might help you locate the issue (in no particular order):
    Code:
    crontab -e
    cat /var/spool/cron/root
    cat /etc/crontab
    ls /etc/cron.daily/*
    
    Do you have anacron or any other alternative crontab like systems running?

    Hope this helps
     
  3. Technus007

    Technus007 Member

    Joined:
    Dec 20, 2008
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    Thanks for reply!

    I'm quite sure timezone and server time is correct, I'm using Eastern European Summer Time (EEST) zone...server or my PC - same times, same zones.

    I don't have any other cron programms I'm using.
    Anyway, I think if I had some two cron-like programms running, then same cronjobs would run twice. But system run them once, and strictly 1 hour before it's set in crontab.

    0 3 * * * upcp
    0 1 * * * cpbackup
     
  4. Spiral

    Spiral BANNED

    Joined:
    Jun 24, 2005
    Messages:
    2,023
    Likes Received:
    7
    Trophy Points:
    0
    Ok, put it to the test then ...

    Change the time of your cron and see if the execution time remains the same or also changes proportionately to the new time.

    If it does ---

    Yes, it is indeed running an hour early
    (OR) you got something strange going on with your logging.

    If it doesn't change ---

    You do have a duplicate cron running somewhere else that
    you will need to find. Meanwhile, yours apparently isn't running.
     
  5. Technus007

    Technus007 Member

    Joined:
    Dec 20, 2008
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    Ok, I'll give it a try...thanks!
     
  6. Technus007

    Technus007 Member

    Joined:
    Dec 20, 2008
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    I tested different times, now I used the following configuration...
    30 23 * * * upcp
    15 22 * * * cpbackup

    In fact upcp started at 22:30 and cpbackup at 21:15 (got e-mail at 21:22).

    I'm confused :confused:
    I dunno how to fix this and why this even happening.
     
  7. Janak

    Janak Well-Known Member

    Joined:
    Jul 18, 2009
    Messages:
    71
    Likes Received:
    1
    Trophy Points:
    6
    Are you on a VPS or own a dedicated server?

    Please post output of below command:

    1. Open SSH.
    2. Run command $ date

    Also, provide output of WHM -> Server Configuration menu -> Server Time.
     
  8. Technus007

    Technus007 Member

    Joined:
    Dec 20, 2008
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    Running dedicated server.

    [root /]# date
    Tue Sep 1 11:33:43 EEST 2009
    [root /]#

    In WHM...
    Current Time
    Tue Sep 1 11:34:25 EEST 2009
     
  9. Spiral

    Spiral BANNED

    Joined:
    Jun 24, 2005
    Messages:
    2,023
    Likes Received:
    7
    Trophy Points:
    0
    Kind of a side off topic but something to note when asking that question ...

    The newer next generation cloud servers are also sometimes called VPS
    which is unfortunate because they are nothing like standard VPS servers
    but many are called VPS but they don't suffer from the locked clock issue
    that you normally find in VPS servers which I presume is the reason why
    you asked this user if they were running a VPS server.

    Just noting that if the user had been on a "VPS", you would probably want
    them to further clarify if it were actually a VPS server or a new cloud server
    that was just called by the name "VPS" (really wish they wouldn't do that).

    In this case, the user said "Dedicated" so doesn't matter but just thought
    I would point out that clarification for anyone who might be interested.

    Back to the topic at hand, I'm fairly certain this issue has to do with daylight savings
    time but just not certain why it's making the adjustment for crontab since that is not
    the default but could probably tell better looking at the settings on that server.

    I am only familiar with North America time zones; Out of curiosity, what is the standing
    on Daylight Savings Time for EEST? Is it an area that has no adjustments?
     
    #9 Spiral, Sep 1, 2009
    Last edited: Sep 1, 2009
  10. Technus007

    Technus007 Member

    Joined:
    Dec 20, 2008
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    Sorry if I didn't get you right, but I guess you're asking about the difference between EET (Eastern European Time) and EEST (Eastern European Summer Time)...the difference is that EEST has +1hour in comparison to EET.
    And you completely stumped me telling that there is some two kinds of VPS available on the market :confused: ... I'd better do a research on those "cloud" next generation VPS servers... :D
    BTW, thanks...I never knew there is some clock lock on VPSes (not those so called "cloud" servers)! :)
     
    #10 Technus007, Sep 1, 2009
    Last edited: Sep 1, 2009
Loading...

Share This Page