我在执行crontab作业时遇到问题。我想我已经把所有东西都配置好了,但是当我把*/2 * * * * /var/www/site/executescript.sh放入crontab -e时,我的脚本根本就没有被执行。我唯一能做的就是:

Feb 15 10:22:35 server crontab[2222]: (root) BEGIN EDIT (root)
Feb 15 10:22:45 server crontab[2222]: (root) REPLACE (root)
Feb 15 10:22:45 server crontab[2222]: (root) END EDIT (root)
Feb 15 10:26:24 server crontab[2329]: (root) BEGIN EDIT (root)
Feb 15 10:27:17 server crontab[2329]: (root) REPLACE (root)
Feb 15 10:27:17 server crontab[2329]: (root) END EDIT (root)
Feb 15 10:29:34 server crontab[2415]: (root) BEGIN EDIT (root)
Feb 15 10:29:53 server crontab[2415]: (root) REPLACE (root)
Feb 15 10:29:53 server crontab[2415]: (root) END EDIT (root)

这意味着cron甚至不想执行我的脚本。有人知道这和什么有关吗?这是否意味着我的脚本中有一个错误(我没有看到一个……)是否有一个地方可以让我检查更精确的cron日志?
我的cron版本是v5.0

最佳答案

您需要定义执行脚本的二进制文件。试试这个:

*/2 * * * * /bin/sh /var/www/site/executescript.sh in

关于linux - crontab不执行工作,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/14893021/

10-16 20:46