我正试图使用每日计划任务更新我的12.04服务器的时钟。我已经按照这里的说明进行了操作,但它仍然不能正常运行:几周后,时钟再次慢了几秒。我一直在谷歌上搜索解决方案,但似乎没有什么帮助。根据我在谷歌上找到的信息,我已验证了以下内容:
手动运行脚本正常:
root@...:~# /etc/cron.daily/ntpdate
13 May 14:42:22 ntpdate[6927]: adjust time server 96.44.142.5 offset -0.018984 sec
脚本是可执行的。
root@...:~# ls -l /etc/cron.daily/
total 60
....
-rwxr-xr-x 1 root root 46 May 12 20:41 ntpdate
....
我在系统日志中没有看到任何与cron相关的错误。
May 13 06:25:01 ... CRON[6704]: (root) CMD (test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily ))
我使用了绝对路径,以防万一cron的路径丢失:
/usr/sbin/ntpdate ntp.ubuntu.com pool.ntp.org
我已经做了一次试运行。
root@...:~# run-parts --test /etc/cron.daily
...
/etc/cron.daily/ntpdate
...
我看不出任何原因导致它不能正常工作。