| Synchronize Linux System Clock With Time Server |
| |
| Summary |
Sometimes, we will notice the system clock is off a few seconds or even
minutes compared to the standard time. There is an easy way to solve this problem.
We can setup a cronjob that will automatically synchronize the system clock with
a public time server. The requirement of this setup is an Internet connection and
some minimal knowledge of cron setup. You can read this
short introduction to understand the setup of cron job on Linux.
|
| |
| Software Required |
- You need a program called ntpdate installed on your Linux system. Usually, this
is installed by default. You may find ntpdate under /usr/sbin/.
|
| |
| Steps |
- Use your favorite editor, type in this line of text
/usr/sbin/ntpdate -s time-nw.nist.gov
This command is instructing the system to sychronize the time with a public
time server at time-nw.nist.gov.
- Save this file with any name in any directory. You must make it executable
by using this command,
chmod 755 yourfile.
- Now set up your cron job by following this
instruction.
- Now ntpdate will run by cron daemon at the time scheduled.
|