linux伺服器時間校對

來源:互聯網
上載者:User

linux伺服器時間校對  一、查看伺服器時間漂移[root@localhost ~]# ntpdate -d pool.ntp.org3 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 ntphost found : 114.80.81.13transmit(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 123stratum 2, precision -19, leap 00, trust 000refid [114.80.81.13], delay 0.07500, dispersion 0.00000transmitted 4, in filter 4reference time:    cfb1abe6.c1705427 Thu, Jun 3 2010 12:19:50.755originate timestamp: cfb1aca6.e02c965f Thu, Jun 3 2010 12:23:02.875transmit timestamp: cfb1aca6.72dc3bd5 Thu, Jun 3 2010 12:23:02.448filter 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.000000delay 0.07500, dispersion 0.00000offset 0.401864server 114.80.81.12, port 123stratum 2, precision -19, leap 00, trust 000refid [114.80.81.12], delay 0.07466, dispersion 0.00002transmitted 4, in filter 4reference time:    cfb1a5be.cab58f10 Thu, Jun 3 2010 11:53:34.791originate timestamp: cfb1aca7.0fc8e87f Thu, Jun 3 2010 12:23:03.061transmit timestamp: cfb1aca6.a5c93ea2 Thu, Jun 3 2010 12:23:02.647filter 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.000000delay 0.07466, dispersion 0.00002offset 0.3895643 Jun 12:23:02 ntpdate[23209]: adjust time server 114.80.81.12 offset 0.389564 sec二、伺服器時間同步[root@localhost ~]# ntpdate pool.ntp.org3 Jun 12:24:52 ntpdate[23216]: adjust time server 114.80.81.12 offset 0.389726 sec三、將時間同步寫入到計劃任務[root@localhost ~]# crontab -l#Time Synchronization0 */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>&1)   作者 ikon

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.