Home » Php » php – Laravel artisan schedule:run running every minute on every install

php – Laravel artisan schedule:run running every minute on every install

Posted by: admin February 25, 2020 Leave a comment

Questions:

I have a VPS with 60 of the same Laravel apps for different regions. Every minute I can see using the htop command that on all of my installs the php command artisan schedule:run fires. As I have so many install it’s actually causing my CPU to be at almost a constant 100% usage.

I have 1 cron set to run daily;

Cron Entry

protected function schedule(Schedule $schedule)
{
   $schedule->command('sitemape:generate')
         ->daily();
}

Handler

public function handle(){
    SitemapGenerator::create(config('app.url'))
        ->writeToFile(public_path('sitemap.xml'));
}

I tried to comment out this function but it still looks like the artisan schedule:run will fire. Is there anyway for me to dig deeper to see what’s actually running and how to stop it?

enter image description here

How to&Answers: