Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我添加了以下条目:
*/1 * * * * /home/coddict/myapp-dev/spoolemailsender
并且我尝试执行的外壳(文件 spoolemailsender)具有以下内容:
#!/bin/sh php app/console swiftmailer:spool:send --env=dev
为什么这个脚本不是每 1 分钟运行一次?我需要另一个命令来运行这个 cron 作业吗?
您忘记让用户执行 cron 作业:
*/1 * * * * root /home/coddict/myapp-dev/./spoolemailsender
或者
*/1 * * * * root sh /home/coddict/myapp-dev/spoolemailsender
root例如。 假设spoolemailsender是可执行脚本,你不需要做./spoolemailsender或sh spoolemailsender
root
spoolemailsender
./spoolemailsender
sh spoolemailsender