5

The below is the schedule function

protected function schedule(Schedule $schedule)
    {
        $schedule->command('queue:work')
            ->everyMinute()
            ->withoutOverlapping();
    }

Below is the cron for laravel

*   *   *   *   *   /usr/local/bin/php /home/space/public_html/project/artisan schedule:run >> /home/space/public_html/project/public/op.txt 2>&1

But each time the cron outputs

No scheduled commands are ready to run.

queue:work is not getting executed, what am I doing wrong?

Sahil Deliwala
  • 802
  • 1
  • 7
  • 14
  • change this /home/space/public_html/project/public/op.txt to kernel of console directory – Morteza Negahi Oct 01 '16 at 06:32
  • @MortezaNegahi But than that will override the kernel with the output of cron.. i used it to check the cron output. – Sahil Deliwala Oct 01 '16 at 06:33
  • In You'r queue:work class . append a Log::('Queue Done . some text'); and when Crone work ended . in your storage/log can see descriptions. – Morteza Negahi Oct 01 '16 at 06:46
  • @MortezaNegahi well queue:work command is of the laravel, do you want me to log in the schedule function? – Sahil Deliwala Oct 01 '16 at 06:51
  • Are you in maintenance mode? Also (just to double check) if you run `php artisan queue:work` manually does it work? – Rwd Oct 01 '16 at 06:56
  • @crazy1337 Look at this [Link](http://stackoverflow.com/questions/32552450/laravel-how-to-log-info-to-separate-file) and Do Ross Wilson comment – Morteza Negahi Oct 01 '16 at 07:00
  • @RossWilson Yep! queue:work works. even the schedule function is called by the cron. but the thing is (i think) ->everyMinute() and other function is not getting recognized in order to run that on time.. – Sahil Deliwala Oct 01 '16 at 07:01
  • @MortezaNegahi Hey when i remove ->withoutOverlapping() then it executes, but queue:work was not running as there were jobs in my queue pending, what might be the reason? – Sahil Deliwala Oct 01 '16 at 07:13
  • @MortezaNegahi Thanks for helping. Deleting all the schedule files in storage/framework did this job. – Sahil Deliwala Oct 01 '16 at 07:36

1 Answers1

7

Deleting all the schedule files in storage/framework did this job.

The problem was the command was executed but was some error so never worked but the command was active preventing it to run again by the cron (because i used withoutOverlapping() ).

Sahil Deliwala
  • 802
  • 1
  • 7
  • 14