ntpdate to update system clock and time

Posted under » Ubuntu » Linux on 20 Dec 2016

Sometimes when you start up your server, the date and time is wrong. This is especially true in a VM environment where we often suspend a VM and then resume it. Then again, if you are running a vm it will get the time from the the host clock which is probably localtime.

$ ntpdate time.nist.gov

If ntpdate is not installed then you need to install it.

Other servers include time.windows.com, etc. http://www.pool.ntp.org/ lists time servers around the world. i

You may have the wrong time because your timezone is wrong. In that case you have to find your timezone and update it

$ timedatectl list-timezones
$ timedatectl set-timezone Asia/Singapore

Put this into your cron to ensure your server's time is always correct.
 

web security linux ubuntu python django git Raspberry apache mysql php drupal cake javascript css AWS data