Linux crond计划任务时间同步

# crontab -l
# 查看现有的时间服务器
* * * * * chronyc sources -v >>/tmp/time.log 2>&1
# 查看时间服务器状态
#* * * * * chronyc sourcestats -v >>/tmp/time.log 2>&1
# 每隔2秒,使用 ntpdate 同步时间
*/2 * * * * /usr/sbin/ntpdate -u 10.159.128.11 >>/tmp/time.log 2>&1
# chronyd 未启动时,使用该命令同步时间
# * * * * * chronyd -q '10.159.128.11' >>/tmp/time.log 2>&1

posted @ 2023-03-09 17:40  LB_运维技术  阅读(79)  评论(0)    收藏  举报