好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

linux服务器时间校对 - Linux操作系统:Ubuntu_Cento

linux服务器时间校对

 

 

一、查看服务器时间漂移

[root@localhost ~]# ntpdate -d pool.ntp.org

3 Jun 12:23:02 ntpdate[23209]: ntpdate 4.2.2p1@1.1570-o Thu Jan 22 02:50:41 UTC 2009 (1)

Looking for host pool.ntp.org and service ntp

transmit(114.80.81.13)

receive(114.80.81.13)

transmit(114.80.81.13)

receive(114.80.81.13)

transmit(114.80.81.13)

receive(114.80.81.13)

transmit(114.80.81.13)

receive(114.80.81.13)

transmit(114.80.81.13)

transmit(114.80.81.12)

receive(114.80.81.12)

transmit(114.80.81.12)

receive(114.80.81.12)

transmit(114.80.81.12)

receive(114.80.81.12)

transmit(114.80.81.12)

receive(114.80.81.12)

transmit(114.80.81.12)

filter delay: 0.07510 0.07500 0.07520 0.07578 

         0.00000 0.00000 0.00000 0.00000 

filter delay: 0.07474 0.07477 0.07466 0.07497 

         0.00000 0.00000 0.00000 0.00000 

3 Jun 12:23:02 ntpdate[23209]: adjust time server 114.80.81.12 offset 0.389564 sec

二、服务器时间同步

[root@localhost ~]# ntpdate pool.ntp.org

3 Jun 12:24:52 ntpdate[23216]: adjust time server 114.80.81.12 offset 0.389726 sec

三、将时间同步写入到计划任务

[root@localhost ~]# crontab -l

#Time Synchronization

四、查看计划任务是否执行

[root@localhost ~]# grep ntpdate /var/log/cron

如果出现下面信息,且每2小时执行一次,说明配置正确

Jun 1 18:00:01 localhost crond[4729]: (root) CMD ("ntpdate pool.ntp.org">/dev/null 2>&1)

Jun 1 20:00:01 localhost crond[5959]: (root) CMD ("ntpdate pool.ntp.org">/dev/null 2>&1)

 

 

 

作者 ikon

查看更多关于linux服务器时间校对 - Linux操作系统:Ubuntu_Cento的详细内容...

  阅读:65次