打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
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
host found : 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)
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)
server 114.80.81.13, port 123
stratum 2, precision -19, leap 00, trust 000
refid [114.80.81.13], delay 0.07500, dispersion 0.00000
transmitted 4, in filter 4
reference time:    cfb1abe6.c1705427 Thu, Jun 3 2010 12:19:50.755
originate timestamp: cfb1aca6.e02c965f Thu, Jun 3 2010 12:23:02.875
transmit timestamp: cfb1aca6.72dc3bd5 Thu, Jun 3 2010 12:23:02.448
filter delay: 0.07510 0.07500 0.07520 0.07578 
         0.00000 0.00000 0.00000 0.00000 
filter offset: 0.401860 0.401864 0.401836 0.401890
         0.000000 0.000000 0.000000 0.000000
delay 0.07500, dispersion 0.00000
offset 0.401864
server 114.80.81.12, port 123
stratum 2, precision -19, leap 00, trust 000
refid [114.80.81.12], delay 0.07466, dispersion 0.00002
transmitted 4, in filter 4
reference time:    cfb1a5be.cab58f10 Thu, Jun 3 2010 11:53:34.791
originate timestamp: cfb1aca7.0fc8e87f Thu, Jun 3 2010 12:23:03.061
transmit timestamp: cfb1aca6.a5c93ea2 Thu, Jun 3 2010 12:23:02.647
filter delay: 0.07474 0.07477 0.07466 0.07497 
         0.00000 0.00000 0.00000 0.00000 
filter offset: 0.389573 0.389545 0.389564 0.389362
         0.000000 0.000000 0.000000 0.000000
delay 0.07466, dispersion 0.00002
offset 0.389564
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
0 */2 * * * "ntpdate pool.ntp.org">/dev/null 2>&1
四、查看计划任务是否执行
[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>&
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
NTP 时间同步实例
NTP协议实现
centos6下时间同步(ntp)操作centos
CentOS服务器时间同步的2种方法
Linux的NTP配置总结
linux时间同步,ntpd、ntpdate
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服