Cron工作与Laravel 5.3在Ubuntu 16.10 x64 [英] Cron Jobs with Laravel 5.3 on Ubuntu 16.10 x64

查看:529
本文介绍了Cron工作与Laravel 5.3在Ubuntu 16.10 x64的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行Digital Ocean的Ubuntu 16.10 x64,并在服务器上部署了php Framework Laravel 5.3.28。
在大多数情况下,一切都正常工作,但我想让crontab调用artisan命令像 php artisan schedule:run ,以便laravel的任务调度器可以投入使用。



我不想下载任何额外的包来使这个工作,因为我觉得不应该真的需要,因为cron可以




crontab -e 中我正在尝试正确编写Ubuntu正确的方法调用 php artisan schedule:run


$ b

我目前尝试多种不同的方式编写此命令,没有什么工作如下所示:

 #尝试cron 
SHELL = / bin / bash
#PATH = < ---混淆,如果这甚至需要
* * * * * php / path / to / artisan scheduled:run 1>> file.log 2>& 1
* * * * * / path / to / php artisan scheduled:run 1>> file.log 2>& 1
* * * * * / path / to / php artisan scheduled:run>> file.log
* * * * * / path / to / php artisan scheduled:run 1>> file.log
* * * * * / path / to / php artisan schedule:run
* * * * * / path / to / php / path / to / artisan scheduled:run 1> file.log

我去过多个资源尝试找到答案,但似乎没有





结论:



此时,我被卡住了。有人可以帮助我吗?所有我想做的是使用Ubuntu的cron调用php artisan命令,我不知道确切的方法。



提前感谢,



节日快乐!

解决方案

这里我们走。这就是我的样子。 :)



* * * * * php / home / spacemudd / laravel / artisan schedule:run> / dev / null 2>& 1


I'm running a Digital Ocean's Ubuntu 16.10 x64 and have deployed the php Framework Laravel 5.3.28 on the server. For the most part everything is working as normal however I'm trying to get the crontab to call artisan commands like php artisan schedule:run so that laravel's task scheduler can be put to use.

I do not wish to download any extra packages to make this work as I feel there shouldn't really be a need to since the cron can call, what looks like, any command if properly coded.

What I'm trying to do:

From within the crontab -e I'm trying to properly write the Ubuntu correct way to call php artisan schedule:run

What I've done:

I've currently tried multiple different ways of writing this command and nothing is working as noted below:

#Attempt for cron
SHELL=/bin/bash
#PATH=????? <---Confused if this is even needed
* * * * * php /path/to/artisan scheduled:run 1>> file.log 2>&1
* * * * * /path/to/php artisan scheduled:run 1>> file.log 2>&1
* * * * * /path/to/php artisan scheduled:run >> file.log
* * * * * /path/to/php artisan scheduled:run 1>> file.log
* * * * * /path/to/php artisan schedule:run
* * * * * /path/to/php /path/to/artisan scheduled:run 1>> file.log

I've gone to multiple resources to try and find the answer but nothing seems to be the answer to my specific problem.

Resources:

Conclusion:

At this point I'm stuck beyond stuck. Can someone please help me? All I'm trying to do is call the php artisan command using Ubuntu's cron and I don't know the exact way to do it. ANY and all assistance is greatly appreciated.

Thanks in advance,

Happy Holidays!!

解决方案

Here we go. That's how mine looks like. :)

* * * * * php /home/spacemudd/laravel/artisan schedule:run >> /dev/null 2>&1

这篇关于Cron工作与Laravel 5.3在Ubuntu 16.10 x64的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆