How to sync the date and time to a time server in Ubuntu Linux (command line)
I just logged in to my Rackspace hosted virtual server running Ubuntu Linux 10.04 and noticed that the time drifted almost a couple of minutes.
Type in the command below to sync your server’s date and time to a time server (where ntp.ubuntu.com is the time server):
sudo ntpdate ntp.ubuntu.com
To automatically correct the time drifting issue in the future, you could also install the ntp daemon:
sudo apt-get install ntp