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 times - Different to when being run !!??

Discussion in 'General Discussion' started by djblamire, Jul 7, 2008.

  1. djblamire

    djblamire Well-Known Member

    Joined:
    May 3, 2003
    Messages:
    250
    Likes Received:
    0
    Trophy Points:
    16
    I have had a fresh install on my dedicated server, and although times are set correctly in the cron, the times they actually take place are different.

    Here is a copy of my settings:

    Code:
    52 0 * * * /scripts/upcp
    0 1 * * * /scripts/cpbackup
    */15 * * * * /usr/local/cpanel/whostmgr/bin/dnsqueue > /dev/null 2>&1
    2,58 * * * * /usr/local/bandmin/bandmin
    0 0 * * * /usr/local/bandmin/ipaddrmap
    14 22 * * * /usr/local/cpanel/whostmgr/docroot/cgi/cpaddons_report.pl --notify
    */5 * * * * /usr/local/cpanel/bin/dcpumon >/dev/null 2>&1
    0 6 * * * /scripts/exim_tidydb > /dev/null 2>&1
    0 4 * * * /backup/backupcron
    
    However /scripts/upcp is being run at at 5:52am, /backup/backupcron is being run at 9:00am.

    I cannot understand this. I have run 'date' on the server shell and it shows the correct date/time.

    Does anyone have any ideas on what could be causing this ??

    Thanks in advance,
    Daniel
     
  2. cpanelinfoseeker

    cpanelinfoseeker Well-Known Member

    Joined:
    Oct 25, 2002
    Messages:
    325
    Likes Received:
    3
    Trophy Points:
    18
    Location:
    NE Illinois
    cPanel Access Level:
    Root Administrator
    Server time and local time are probably not the same. From your example, it appears to be a 5 hour difference. The cron runs on the server time setting.

    Ron
     
  3. djblamire

    djblamire Well-Known Member

    Joined:
    May 3, 2003
    Messages:
    250
    Likes Received:
    0
    Trophy Points:
    16
    What's the best way to check/correct this ?

    Thanks
    Daniel
     
  4. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    If you've changed your timezone, date or time on the server you have to restart crond for it to take effect as vixie-cron doesn't take the change into account:

    service crond restart
     
  5. djblamire

    djblamire Well-Known Member

    Joined:
    May 3, 2003
    Messages:
    250
    Likes Received:
    0
    Trophy Points:
    16
    I haven't changed anything though yet...

    The timezone is already correct, and the date command shows the correct time....

    Any other ideas ?

    Thanks
    Daniel
     
  6. djblamire

    djblamire Well-Known Member

    Joined:
    May 3, 2003
    Messages:
    250
    Likes Received:
    0
    Trophy Points:
    16
    Thanks! - Your command did indeed fix the problem :)
     
Loading...

Share This Page