ntp时间同步
时间:2021-06-17 16:54:51
收藏:0
阅读:0
1:开机同步
开机时自动同步可编辑 /etc/ntp/step-tickers 文件
1 vim /etc/ntp/step-tickers 2 3 # List of NTP servers used by the ntpdate service. 4 5 ntp.aliyun.com 6 time2.aliyun.com 7 ntp2.aliyun.com
2:定时同步可使用 crontab,添加定时任务
systemctl start crond
systemctl enable crond
# 添加
crontab -e
# 每两个小时同步一次
0 */2 * * * ntpdate s2m.time.edu.cn && hwclock -w
# 查看
crontab –l
评论(0)