We don’t have to install NTP server, so we will install a simple client called ntpdate. Ntpdate sets the local date and time by polling the Network Time Protocol (NTP) server(s) given as the server arguments to determine the correct time. It must be run as root on the local host.
Please note that ntpdate will decline to set the date if an NTP server daemon (ntpd) is running on the same host. When running ntpdate on a regular basis from cron as an alternative to running a daemon, doing so once every hour or two will result in precise enough timekeeping to avoid stepping the clock.
Installation
$ sudo apt-get install ntpdate
ntpdate will automatically run when your network interface get activated by system (i.e. while booting Ubuntu Linux sever/desktop system) . Ubuntu Linux stores script at /etc/network/if-up.d/ntpdate location.
If you wish to just run script again just type command:
$ sudo /etc/network/if-up.d/ntpdate
OR
$ sudo ntpdate pool.ntp.org
Install as cronjob
To avoid stepping the clock you must run ntpdate every 1 or 2 hours using cronjob:
crontab -e
Now add hourly job:
#NTPDATE
@hourly /etc/network/if-up.d/ntpdate
Save and close the file.
Easy way.
RIGHT CLICK on desktop clock and select “set date / time” there’s an option to automatically set the time, and select the ntp.ubuntu.com servers so you don’t load the pub servers.







