One of our servers was running way out of time. More than 2 hours. So I installed the ntp daemon:

Two methods do exist: ntpdate and ntpd(aemon). I'm just skipping the ntpdate part and jump into the ntpd method. Read more.

ntpd


The ntp daemon ntpd calculates the drift of the system clock and continuously adjusts it.

To set up ntpd:

sudo apt-get install ntp

Changing Time Servers


The system will now use Ubuntu's NTP server by default. But you better use time servers geographically closer to your situation (Netherlands). Therefore edit /etc/ntp.conf  to add these server lines (and remove other serverlines):
server 0.nl.pool.ntp.org
server 1.nl.pool.ntp.org
server 2.nl.pool.ntp.org
server 3.nl.pool.ntp.org

and run
sudo service ntp restart

now wait a little bit and check if date and time is corrected.

-- let's thinks what I learned at the lpi course about this subject.

Written by Knilluz on 10 May 2012 at 08:40