Linux下使用ntpdate进行时间同步
生活随笔
收集整理的這篇文章主要介紹了
Linux下使用ntpdate进行时间同步
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
1、安裝ntpdate,執(zhí)行以下命令
# yum install ntpdate -y2、手工同步網(wǎng)絡時間,執(zhí)行以下命令,將從time.nist.gov同步時間
# ntpdate 0.asia.pool.ntp.org若上面的時間服務器不可用,也可以選擇以下服務器同步時間
time.nist.gov
time.nuri.net
0.asia.pool.ntp.org
1.asia.pool.ntp.org
2.asia.pool.ntp.org
3.asia.pool.ntp.org
3、使用crontab計劃任務定時更新網(wǎng)絡時間,修改crontab文件,在末尾增加* */1 * * * ntpdate 0.asia.pool.ntp.org,每隔1小時同步一次時間。
# vi /etc/crontab4、使用date命令查看當前時間
5、系統(tǒng)時間同步到硬件,防止系統(tǒng)重啟后時間唄還原
# hwclock --systohc?
轉(zhuǎn)載于:https://www.cnblogs.com/alittlesmile/p/10919319.html
總結(jié)
以上是生活随笔為你收集整理的Linux下使用ntpdate进行时间同步的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: jenkins——部署java项目(2)
- 下一篇: 2. 性能测试中常见术语集合