我正在运行Ubuntu12.04 LTS桌面。
我使用/etc/crontab设置了几个应该以不同时间运行的条目。
现在的问题是,这些似乎没有运行。我在其他的ubuntu系统中使用了相同的条目,它们工作得很好。
以下是我的crontab文件:
#--------------------------------------------------------------------------------
# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab'
# command to install the new version when you edit this file
# and files in /etc/cron.d. These files also have username fields,
# that none of the other crontabs do.
SHELL=/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
# m h dom mon dow user command
17 * * * * root cd / && run-parts --report /etc/cron.hourly
25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
47 6 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
52 6 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
6 2-6/2 * * * root wget localhost/estimator/update_to_cs.php
26 2-6/2 * * * root wget localhost/estimator/update_estimator_cron.php
* * * * * printo touch /home/printo/test_cron_output.txt
* * * * * printo date >> /home/printo/test_cron_output.txt
#--------------------------------------------------------------------------------用户printo存在并具有sudo特权。
ps -ef | grep cron显示cron正在运行。
关于我可能遗漏了什么或者找到问题根源的方法,有什么建议吗?
蒂娅。
发布于 2014-01-28 08:04:50
我设法找到并解决了这个问题。我查看了/var/log/syslog,发现cron抱怨格式化错误/无效字符。
cat -v /etc/crontab显示了文件中有一些非打印字符,然后我删除了这些字符,它工作得很好。
谢谢你的帮助。
https://askubuntu.com/questions/411535
复制相似问题