首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >未运行的系统crontab项

未运行的系统crontab项
EN

Ask Ubuntu用户
提问于 2014-01-27 14:26:47
回答 1查看 3K关注 0票数 1

我正在运行Ubuntu12.04 LTS桌面。

我使用/etc/crontab设置了几个应该以不同时间运行的条目。

现在的问题是,这些似乎没有运行。我在其他的ubuntu系统中使用了相同的条目,它们工作得很好。

以下是我的crontab文件:

代码语言:javascript
复制
#--------------------------------------------------------------------------------
# /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正在运行。

关于我可能遗漏了什么或者找到问题根源的方法,有什么建议吗?

蒂娅。

EN

回答 1

Ask Ubuntu用户

发布于 2014-01-28 08:04:50

我设法找到并解决了这个问题。我查看了/var/log/syslog,发现cron抱怨格式化错误/无效字符。

代码语言:javascript
复制
cat -v /etc/crontab

显示了文件中有一些非打印字符,然后我删除了这些字符,它工作得很好。

谢谢你的帮助。

票数 1
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/411535

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档