题目:在每天早上9点钟,让你的服务器可以通过ntp.aliyun.com和ntp.tencent.com同步自己的时间。
注意点:时间服务器配置好,要能够上网,systemctl enable chronyd,设置一个开机就自动加载的能够上网的地址(网关和dns服务器),crontab
下载chrony服务,并启动
写入需要同步时间的服务器
[root@localhost /]# vim /etc/chrony.conf
写入配置后,需要重新启动服务
[root@localhost /]# systemctl restart chronyd
[root@localhost /]# chronyc sources 查看时间服务器
设置时间服务器开机自启
[root@localhost /]# systemctl enable chronyd
写入任务
[root@localhost /]# vim /etc/crontab