Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

Instead of using the ntp daemon, here is the traditional means to syncing time. This approach was taught to me by Dickson and works on systems other than Ubuntu.

The advantage over the traditional cron tab approach is,

  • Less inconsistency in logs for when there are large time corrections. 
  • A little processing power and memory, but for a modern server this is negligible.

Code Block
languagebash
date # determine current timezone

If need be change your time zone,

Code Block
languagebash
sudo dpkg-reconfigure tzdata # sets the timezone

Next we make sure the time stays correct.

Make ntpdate Scheduled in the chrontab (Scheduled Job):

Code Block
languagebash
sudo crontab -e

At this point you will be asked to choose a default editor. I recommend selecting nano if you are a beginner. You can always change the default editor later with, select-editor.

Add to the bottom of the file,

Code Block
langhtml
# update time and date every morning at 5:00.
00 05 * * * ntpdate ntp.ubuntu.com pool.ntp.org

Hit keys, CTRL-O and Enter (save in nano)
Hit keys, CTRL-X (exit in nano)

Panel

Here is another method using a file creation.

Next, verify that the crontab was updated successfully by listing the crontab. (Note: you don't need sudo to do this).

Code Block
languagebash
crontab -l