ntpdate
ntpdate 进行时间的查询和时间同步
使用ntpdate同步时ntpd服务不能运行,否则会报错
指定时间源进行查询
ntpdate -q 0.centos.pool.ntp.org
如果想定时进行时间校准,可以使用crond服务来定时执行。
30 8 * * * root /usr/sbin/ntpdate 0.centos.pool.ntp.org; /sbin/hwclock -w
ntpdate默认不能修改硬件时间,需要使用hwclock进行同步
ntpdate 进行时间的查询和时间同步
使用ntpdate同步时ntpd服务不能运行,否则会报错
指定时间源进行查询
ntpdate -q 0.centos.pool.ntp.org
如果想定时进行时间校准,可以使用crond服务来定时执行。
30 8 * * * root /usr/sbin/ntpdate 0.centos.pool.ntp.org; /sbin/hwclock -w
ntpdate默认不能修改硬件时间,需要使用hwclock进行同步