【CentOS】CentOS7 自动同步时间:服务ntp,命令ntpdate

ntp的安装配置

安装ntp

$ yum -y install ntp

 

启动ntp服务器

$ systemctl start ntpd

 

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

# 启动并开机启动计划任务cron
$ systemctl start crond
$ systemctl enable crond

# 配置计划任务,每5分钟同步一次
$ crontab -e
*/5 * * * * /usr/sbin/ntpdate ntp1.aliyun.com

 

posted @ 2020-03-19 14:50  蓝色星辰1993  阅读(6384)  评论(0编辑  收藏  举报