Ahmad Al- Hashlamoun
Ahmad Al- Hashlamoun

Reputation: 143

My Laravel scheduler run only once each time I run it and then it stops

I've a Laravel 5.3 on an Azure instance, everything is working cool there except my task scheduler, I'm tryin to run an Artisan command automatically every midnight, when I run the same command from the CLI it works well. I tried to use this command as in the Laravel Doc:

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

it worked out just once, then the process ends and not repeated for the 2nd round.

What should I do to let the scheduler run the task everyday?

P.S: here's my code how do I run the command through the kernel:

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

Upvotes: 2

Views: 2535

Answers (1)

Niraj Shah
Niraj Shah

Reputation: 15457

Since your command is scheduled to run daily, it will only run once per day if you use schedule:run.

If you wish to run the particular command manually (and more than once in a day), you can use the following from command line:

php /path-to-your-project/artisan rentalRates:run

Upvotes: 3

Related Questions