Using Laravel, I have a cron in Kernel.php
that doesn't seem to run when just left to run, if I run php artisan command-name
manually, it does work. Below is what I have in Kernel.php
, I'm not sure what's stopping it running every 5 minutes, automatically:
$schedule->command('command-name')
->everyFiveMinutes()
->withoutOverlapping()
->runInBackground()
->sendOutputTo(storage_path('logs/command-name.log'));
withoutOverlapping should create a file in storage folder with a name as
schedule_123456....
If the command stopped abruptly this file could remain undeleted. I think you have to delete it manually.
Two things:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.