This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
linux:setting_the_clock_using_ntp [2008/06/11 21:25] Joel Dare |
linux:setting_the_clock_using_ntp [2020/06/01 22:53] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Set Clock Using NTP ====== | ||
+ | |||
+ | Note: There is a strain on the first tier of time servers. If you don't have a very specific need to be more accurate than 10ths of seconds, you should use your ISP's time server, something near you, or a random server from <del>pool.ntp.com</del>. | ||
+ | |||
+ | Setup the service to start at boot. | ||
+ | |||
+ | chkconfig ntpd on | ||
+ | |||
+ | Set the time server. | ||
+ | |||
+ | ntpdate ntp.xmission.com | ||
+ | |||
+ | Start the NTPD service (Redhat / CentOS way). | ||
+ | |||
+ | service ntpd start | ||
+ | |||
+ | Setup the clock to sync at boot, add the following to /etc/rc.local. This is not typically necessary, because the clock is set at regular intervals by the ntp daemon. But, on a system that has a time issue such as a dead CMOS battery, this can be useful. | ||
+ | |||
+ | # initial clock sync | ||
+ | /etc/init.d/ntpd stop | ||
+ | /usr/sbin/ntpdate -b ntp1.hurdman.org | ||
+ | /usr/sbin/ntpdate -b ntp2.hurdman.org | ||
+ | /etc/init.d/ntpd start | ||