Update Ubuntu Time

One of the methods I know to update my system time is through this command:

sudo ntpdate ntp.ubuntu.com

The reason I need to run this so frequently because I use VM to put it into suspension. Rather than using the system suspension or hibernate method. So this gives me more inaccurate time when waking it up.

So I make it into a bash script to run it whether I wake it up. You can also make it into cron job so it can check the latest time daily

sudo chmod 755 /etc/cron.daily/ntpdate
Advertisements