centos7时间不同步,ntpd时间同步服务

安装,启动ntp,并设置为开机自启动

yum -y install ntp

systemctl start ntpd
systemctl enable ntpd

配置计划任务,使用ntpdate同步时间

# 启动并开机启动计划任务cron

systemctl start crond

systemctl enable crond

# 配置计划任务,每5分钟同步一次

crontab -e

*/5 * * * * /usr/sbin/ntpdate ntp1.aliyun.com

 

posted @ 2020-11-04 16:31  hanjianfei  阅读(574)  评论(0编辑  收藏  举报