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.

Automatic Time Syncronisation Cron?

Discussion in 'General Discussion' started by osirion, Jun 5, 2017.

  1. osirion

    osirion Active Member

    Joined:
    Jan 16, 2007
    Messages:
    35
    Likes Received:
    2
    Trophy Points:
    158
    Hi Guys,
    My server time seems to go off whenever there is a restart/downtime. Now - this doesnt happen often (as it shouldnt) - but thats when it appears to happen.
    For example, this weekend we took down the server to upgrade the memory. Today when I checked, I noticed it was 1-2 hrs behind.
    A simple check in the WHM and clicking the "Sync time with Time Server" button under Server Time fixes it - but shouldnt it be checking this regularly?

    From my understanding, this happens as part of the upcp process and I checked my cront and its there - so not sure why its not updating:
    26 3 * * * /usr/local/cpanel/scripts/upcp --cron
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,171
    Likes Received:
    1,295
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    It depends on the server environment (e.g. VPS, dedicated). You can verify what your server environment is with a command such as:

    Code:
    cat /var/cpanel/envtype
    For instance, if it's a virtual environment, the rdate script does not run during the nightly maintenance:

    Code:
    Processing: Setting clock
    Processing command `/usr/local/cpanel/scripts/rdate`
    Virtual environment detected - rdate skipped
    However, you could add a custom root cron job using the "crontab -e" command while logged in via SSH as root if you wanted to sync the server time on a regular basis:

    Code:
    0 6 * * * /usr/bin/rdate -s rdate.cpanel.net 2>&1 >> /dev/null
    Thank you.
     
  3. osirion

    osirion Active Member

    Joined:
    Jan 16, 2007
    Messages:
    35
    Likes Received:
    2
    Trophy Points:
    158
    Thanks Michael - will give that a try, I'm sure thats it.
     
Loading...

Share This Page