我们有许多脚本设置在其中运行/etc/cron.daily directory
- 其中一些显示在大约正确的时间运行的证据(文件被存档/压缩和截断),但其他似乎被忽略了。
检查两者/var/log/cron.log
并/var/log/syslog
没有列出任何日常工作 - 只有每小时(和几个 20 分钟的工作)。
某处还有其他日志吗?crontab 包含以下几行:
17 * * * * root cd / && run-parts --report /etc/cron.hourly
25 4 * * * 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 )
什么是 20 分钟的工作?看起来您已粘贴
/etc/crontab
,并且没有 20 分钟的条目。的内容是
/var/log/cron.log
什么?权限是否
/etc/cron.daily
正确?(例如应该至少是r-x
根)里面的脚本
/etc/cron.daily
有执行权限吗?做什么
打印?
如果您在该目录中添加一个新脚本会发生什么情况,该脚本执行一些您可以验证的微不足道的事情,例如
包含什么
/etc/syslog.conf
?它应该是这样的:如果是
cron.notice
orcron.warn
或cron.err
而不是cron.*
,则并非所有活动都将记录到/var/log/cron.log
.如果 cronjob 有输出或失败,如果安装了 bsd-mailx 软件包,cron 将向用户发送邮件。使用命令阅读此类邮件
mail
。