mardi 27 novembre 2018

Laravel Cron not starting automatically

I have set up a cron job which must run every minute. The task is simply to delete the content of a table in my database. But the task is never fired. It fires only if I call php artisan schedule:run. I'm on MacOS. I have tried:

* * * * * cd /applications/mamp/htdocs/myproject && /usr/local/bin/php artisan schedule:run >> /dev/null 2>&1

and

* * * * * /usr/local/bin/php /applications/mamp/htdocs/myproject/artisan schedule:run >> /dev/null 2>&1

But none works.

My task is defined in app/Console/Kernel.php:

$schedule->call(function() {
            DB::table('test_cron')->delete();
        })->everyMinute();



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire