【发布时间】:2021-06-27 10:57:13
【问题描述】:
我正在尝试将我的 script.sh 脚本安排为从周一到周五每天上午 9:35 运行。当我直接在终端中使用 ./ 运行我的脚本时,一切正常。但是当我尝试在 crontab -e 中运行时,没有任何效果。 这是我尝试过的列表:
- * * * * * root /bin/script.sh
- * * * * * root sh /bin/script.sh
- * * * * * root bash /bin/script.sh
- * * * * * root / bin / sh /bin/script.sh
- * * * * * /bin/script.sh
- * * * * * sh /bin/script.sh
- * * * * * bash /bin/script.sh
- * * * * * / bin / sh /bin/script.sh
我每分钟执行一次,只是为了测试。 否则最终的命令会是这样的:
- 35 9 * * 1-5 /bin/script.sh
我一定忘记了一个重要的步骤或什么的。 当然,我每次修改都会重新启动cron:
- service cron restart
【问题讨论】: