简体   繁体   English

Laravel计划任务不在Cron上运行,但与工匠一起使用

[英]Laravel scheduled task is not running with Cron, but works with artisan

I have created scheduled task and it's running smoothley with command: 我已经创建了计划任务,并且正在使用命令运行Smoothley:

php artisan schedule:run

Also I'm able to run it with command: 我也可以使用命令运行它:

php /var/www/my.app/artisan schedule:run >> /dev/null 2>&1

But when I try to run 但是当我尝试跑步时

* * * * * php /var/www/my.app/artisan schedule:run >> /dev/null 2>&1

as it described in Laravel doc's here: https://laravel.com/docs/5.5/scheduling - nothing happends. 如Laravel文档中所述: https ://laravel.com/docs/5.5/scheduling-没有任何反应。 If I remove 如果我删除

>> /dev/null 2>&1

(which is here to hide output). (这里是隐藏输出)。 I'm getting: 我越来越:

Command not found

Thanks for any help. 谢谢你的帮助。

Just in case I used this command to add line to cron: 以防万一我使用此命令向cron添加行:

(crontab -l ; echo "* * * * * php /var/www/bmon.app/artisan schedule:run >> /dev/null 2>&1")| crontab -

Nice description here: https://askubuntu.com/questions/408611/how-to-remove-or-delete-single-cron-job-using-linux-command 不错的描述在这里: https : //askubuntu.com/questions/408611/how-to-remove-or-delete-single-cron-job-using-linux-command

在您的cron中添加以下行:

* * * * * php /var/www/my.app/artisan schedule:run >> /dev/null 2>&1

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM