与时间服务器上的时间同步的方法

1.  安装ntpdate工具

# yum -y install ntp ntpdate

2.  设置系统时间与网络时间同步

# ntpdate cn.pool.ntp.org

3.  将系统时间写入硬件时间

# hwclock --systohc

 

使用命令 crontab -e 设置定时更新时间
crontab -e
10 5 * * * root ntpdate cn.pool.ntp.org;hwclock -w
每天5:10自动进行网络校时,并同时更新BIOS的时间

posted on 2017-11-03 22:39  jarod99  阅读(257)  评论(0编辑  收藏  举报