我想每 24 小时运行一次 python 脚本,每 23:59:58 我想终止这项工作。我想立即运行python。因此我在下面使用这个语法
* */24 * * * cd /ftp/ftp1 && timeout -s 9 86398 python2.6 lpr_10.10.252.121.py 10.10.252.121 450 >> res_10.10.252.121.txt
Run Code Online (Sandbox Code Playgroud)
但是在 cron 日志上,他们的脚本没有运行。我试着/etc/rc.d/init.d/crond restart
这是日志cron
May 18 10:13:45 cisco-cumc crontab[31368]: (root) REPLACE (root)
May 18 10:13:45 cisco-cumc crontab[31368]: (root) END EDIT (root)
May 18 10:14:01 cisco-cumc crond[5090]: (root) RELOAD (/var/spool/cron/root)
May 18 10:15:24 cisco-cumc crontab[31449]: (root) BEGIN EDIT (root)
May 18 10:15:42 cisco-cumc crontab[31449]: (root) REPLACE (root)
May 18 10:15:42 cisco-cumc crontab[31449]: (root) END …Run Code Online (Sandbox Code Playgroud)