【发布时间】:2017-02-21 01:35:27
【问题描述】:
我创建了一个 cron 作业,需要在每天 00:01 触发。详情如下:
Cronjob 配置:
01 00 * * * root /usr/bin/python /opt/scripts/tune.py -t & >/dev/null &
文件的权限和位置:
root@localhost:/etc/cron.d# ll /etc/cron.d/database_tuning
-rw-r--r-- 1 root root 80 Oct 12 01:04 /etc/cron.d/database_tuning
但是,此 cronjob 不会在指定的时间间隔内自动触发。现在,一旦我编辑此文件,并将时间更改为上午 01:12,例如 (12 01 * * *)。然后自动触发成功。所以我确认脚本/环境没有问题,但我无法理解为什么 cronjob 没有在 00:01 AM 触发。最好的调试方法是什么?
【问题讨论】:
-
01 0 * * * root /usr/bin/python /opt/scripts/tune.py -t & >/dev/null &-----> 我相信应该只有一个以小时为单位输入数字,编号从 0-23 开始。