gregkaleka
7092
43
Laravel

schedule:run not calling artisan command

Posted 4 years ago by gregkaleka

I have a task scheduled to run an artisan command, and for some reason schedule:run is not working properly.

Here is my schedule() function:

    protected function schedule(Schedule $schedule)
    {
        $schedule->command('inspire')
                 ->hourly();
        $schedule->command('mydomain:sendalerts 100')
                 ->everyMinute();

        // $schedule->call(function() {
        //     Mail::raw('Testing from mydomain', function($message)
        //     {
        //         $message->to('me@gmail.com')->from('alerts@mydomain.com');
        //     });
        // })->everyMinute();
    }

In the console, calling php artisan mydomain:sendalerts 100 works. Calling php artisan schedule:run does not work. However, when the code below is un-commented, calling php artisan schedule:run does send the test email. So schedule:run is working. The command is working. But schedule:run does not successfully call the command.

When I call php artisan schedule:run, here is the console output:


root@mydomain:/var/www/laravel/current# php artisan schedule:run
Running scheduled command: /usr/bin/php5 "artisan" mydomain:sendalerts 100 > /dev/null 2>&1 &

What am I doing wrong??

Please sign in or create an account to participate in this conversation.