Linux下使用ntpdate进行时间同步
时间:2020-12-31 12:13:31
收藏:0
阅读:0
1、安装ntpdate,执行以下命令
# 安装utpdate命令 yum install ntpdate -y

2、手工同步网络时间,执行以下命令,将从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
vi /etc/crontab * */1 * * * ntpdate 0.asia.pool.ntp.org # 每隔1小时同步一次时间。


date
5、系统时间同步到硬件,防止系统重启后时间呗还原
hwclock --systohc

评论(0)