Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Automatic Time Syncronisation Cron?

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

  1. osirion

    osirion Well-Known Member

    Joined:
    Jan 16, 2007
    Messages:
    50
    Likes Received:
    4
    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:
    43,711
    Likes Received:
    1,791
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. osirion

    osirion Well-Known Member

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

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice