本文共 1813 字,大约阅读时间需要 6 分钟。
CentOS时间同步
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | [root@node-01 ~] # yum install ntpdate -y Loaded plugins: fastestmirror Setting up Install Process Loading mirror speeds from cached hostfile * base: mirrors.163.com * extras: mirrors.zju.edu.cn * updates: mirrors.163.com Resolving Dependencies --> Running transaction check ---> Package ntpdate.x86_64 0:4.2.6p5-10.el6.centos.2 will be installed --> Finished Dependency Resolution Dependencies Resolved ================================================================================================================================ Package Arch Version Repository Size ================================================================================================================================ Installing: ntpdate x86_64 4.2.6p5-10.el6.centos.2 base 78 k Transaction Summary ================================================================================================================================ Install 1 Package(s) Total download size: 78 k Installed size: 123 k Downloading Packages: ntpdate-4.2.6p5-10.el6.centos.2.x86_64.rpm | 78 kB 00:00 Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Installing : ntpdate-4.2.6p5-10.el6.centos.2.x86_64 1 /1 Verifying : ntpdate-4.2.6p5-10.el6.centos.2.x86_64 1 /1 Installed: ntpdate.x86_64 0:4.2.6p5-10.el6.centos.2 Complete! |
1 2 | [root@node-01 ~] # /usr/sbin/ntpdate cn.pool.ntp.org 27 Jul 15:24:41 ntpdate[1674]: step time server 85.199.214.101 offset -27705.095972 sec |
1 2 3 4 | [root@node-01 ~] # crontab -e [root@node-01 ~] # crontab -l # time sync * /5 * * * * /usr/sbin/ntpdate cn.pool.ntp.org > /dev/null 2>$1 |