2018-11-19 07:52
浏览 63

Laravel - 最后使用OS cron作业时,调度时间设置的用法是什么?

Laravel docs:

          • cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1

This Cron will call the Laravel command scheduler every minute. When the schedule:run command is executed, Laravel will evaluate your scheduled tasks and runs the tasks that are due.

I run these codes below in app\Console\Kernel.php:

$schedule->job(new \App\Jobs\done)->everyMinute();

but none of them worked! so I run the command php artisan schedule:run but it runs only once and each time I want to make it trigger the job/command I should run that command so I tried to use the command above in Laravel docs. However again it didn't work every minute. So I tried to create a task in Task Scheduler and run it every 5 minutes(because it didn't have less than 5) now it's working but the usage of ->everyMinute() is redundant because the schedule of Laravel only runs but the main job that is done is by Windows Task Scheduler. So how can I fix it in order not to use cron job nor windows task scheduler?


1条回答 默认 最新

相关推荐 更多相似问题