Centos7自动同步时间 服务ntp 命令ntpdate

2021年2月5日07:24:41 评论 1,127
首月免费体验

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
weinxin
博主微信
这是我的微信扫一扫

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: