Your server’s hardware clock isn’t perfectly accurate. It may run faster or slower (in my experience it was always slower). So it is important to synchronize it every so often, or else you might encounter some unexpected bugs. There’s a command in Ubuntu that synchronizes hardware clock against atomic clock servers. It’s called ntpdate
1 2 |
|
This one was three minutes behind. Could be worse, though. So, now clock is more or less accurate. To keep it this way, let’s add an hourly cron job. Create a file called ‘ntpdate’ (for example) at ‘/etc/cron.hourly’ with this content:
1 2 3 |
|
We don’t need sudo here, because these jobs are run with root privileges. Now make that file executable.
1
|
|
We’re all set now. Come back a few days later and verify that clock doesn’t deviate as much anymore.