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
  • for clarify please share your mentioned command and controller Commented May 20, 2022 at 11:15

1 Answer 1

1

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
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.