-
Updating Server Time on Ubuntu
A handy way to help keep a Ubuntu server’s date current is to add a daily cron job that runs the ntpdate command. To do this you just repeat the following in a terminal.
Create a file named ntpdate in /etc/cron.daily/ :sudo nano /etc/cron.daily/ntpdate
Now add the following to this file:ntpdate ntp.ubuntu.com pool.ntp.org
Save and exit, then make the job executable:
sudo chmod 755 /etc/cron.daily/ntpdate
Your server will now update once a day using either the ntp.ubuntu.com or pool.ntp.org time server. But there is a better way...A much simpler method is to add the ntp daemon. This use to be called ntp-simple when using apt, but it is now just ntp on Hardy:
sudo apt-get install ntp
To add more time servers, edit the ntp.conf file and modify the settings:sudo nano /etc/ntp.conf server ca.pool.ntp.org server pool.ntp.org
Leave a reply