linux crontab+ntpdate同步时间

上传:bbgoods 浏览: 28 推荐: 0 文件:PDF 大小:24.04KB 上传时间:2021-01-14 21:50:58 版权申诉
发现服务器时间错了,设置下定时任务。 crontab -u root -e # 编辑内容 加入以下语句 每十分钟同步一次时间 */10 * * * * /usr/sbin/ntpdate ntp1.aliyun.com 第二天发现不起作用。 手动设置下,执行一下语句。 /usr/sbin/ntpdate ntp1.aliyun.com 发现报错如下: 21 Sep 14:39:09 ntpdate[24744]: the NTP socket is in use, exiting 解决方法:停止ntpd service ntpd stop crontab 定时任务还需要观察几天 参考:
上传资源
用户评论