Automatic Time Syncronisation Cron?

osirion

Well-Known Member
Jan 16, 2007
64
6
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
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,261
463
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
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.