1

hi i want to run laravel scheduler in vps (linux ubunto 20.04 nginx)

in Kernel.php

protected function schedule(Schedule $schedule)
{
 $schedule->job(function (){
            $run= new [ ControllerName() ];
            $run->index();
 })->everyMinute();
}

then i run this command in terminal (php artisan schedule:run) in project location in vps;

i get [2022-05-20T15:33:06+04:30] Running scheduled command: App\Http\Controllers\CrawlerController

this but nothig happend :/

what can i do to fix it?

1 Answers1

0

open crontab -e in your server and paste below code and don't forget to change path-to-your-project like cd /var/www/testproject.

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