最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

cron - Laravel 11 Crontab configuration with O2Switch server - Stack Overflow

programmeradmin4浏览0评论

I'm trying to set up the Laravel 11 scheduler on my O2Switch hosting.

Here's the line declared in my crontab.

* * * * * cd link_to_project && php artisan schedule:run >> /dev/null 2>&1

When I run the scheduler via the crontab the return of the command is as if I just did scheduler:list instead of the real scheduler:run.

EDIT :

I put this line in the crontab:

* * * * * cd link_to_project && php artisan schedule:run >> /dev/null 2>&1

And that's how I could see that the return of the command looked like a schedule:list instead of a schedule:run.

I'm trying to set up the Laravel 11 scheduler on my O2Switch hosting.

Here's the line declared in my crontab.

* * * * * cd link_to_project && php artisan schedule:run >> /dev/null 2>&1

When I run the scheduler via the crontab the return of the command is as if I just did scheduler:list instead of the real scheduler:run.

EDIT :

I put this line in the crontab:

* * * * * cd link_to_project && php artisan schedule:run >> /dev/null 2>&1

And that's how I could see that the return of the command looked like a schedule:list instead of a schedule:run.

Share Improve this question edited Feb 17 at 16:31 HEXALIX asked Feb 17 at 16:00 HEXALIXHEXALIX 719 bronze badges New contributor HEXALIX is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct. 2
  • you can send the output of your command to a file rather than dev/null to check for errors – kris gjika Commented Feb 17 at 16:17
  • Indeed, I didn't specify it, but that's what I did to see that the return of the command looked like a schedule:list instead of a schedule:run. – HEXALIX Commented Feb 17 at 16:28
Add a comment  | 

1 Answer 1

Reset to default 2

I've already had the same problem with an O2Switch server. Here's how to solve your problem.

In your crontab, you need to specify the full path of PHP as well as the absolute path of your project.

* * * * * /usr/local/bin/php /home/NAME/link_to_project/artisan schedule:run >> /dev/null 2>&1

This will allow the cron job to run normally.

发布评论

评论列表(0)

  1. 暂无评论