【发布时间】:2018-01-29 22:36:27
【问题描述】:
我在根 crontab 中配置了一些任务,例如:
1 * * * * zcat -f /var/log/apache2/custom.site1.log.* | goaccess --log-format COMMON -o /var/www/site1/reports/index.html
2 * * * * zcat -f /var/log/apache2/error.site1.log.* | goaccess --log-format='[%^ %d %t.%^ %^] [%^] [%^] [%^ %h:%^] %^: %U, %^: %R' --time-format=%T --date-format='%b %d' --http-protocol=no --http-method=no -o /var/www/site1/reports/errors.html
使用cat /var/log/syslog | grep CRON,我看到它应该每小时开始一次:
Jan 29 12:05:01 sd-102290 CRON[21454]: (root) CMD (zcat -f /var/log/apache2/error.site1.log.* | goaccess --log-format='[)
Jan 29 12:05:01 sd-102290 CRON[21465]: (root) CMD (zcat -f /var/log/apache2/custom.site1.log.* | goaccess --log-format COMMON -o /var/www/site1/reports/index.html)
但它不起作用。从命令行执行时,该命令就像一个魅力。 我不知道我可以从这个 cron 的错误中查看哪里。
此外,我看到我的命令在 syslog 中似乎被截断(它在 goaccess --log-format='[ 处停止)
谢谢
【问题讨论】: