1
I have a cron that should be running every day in an hour.
$Schedule->command('inspire')->dailyAt('15:00');
but he is not being executed
Code
<?php
namespace App\Units;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel;
use App\Console\Commands\EnvioEmailBlCron;
class ConsoleKernel extends Kernel
{
/**
* The Artisan commands provided by your application.
*
* @var array
*/
protected $commands = [
\App\Console\Commands\EnvioEmailBICron::class
];
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
*/
protected function schedule(Schedule $schedule)
{
//configuração do cron
$schedule->command('inspire')->dailyAt('15:00');
$schedule->command('envioemailbicron:cron')->daily(); // email diários
}
/**
* Register the Closure based commands for the application.
*/
protected function commands()
{
}
}
Command running on cmd:
php Artisan envioemailbicron:cron
Not this command. The command to execute is
php artisan schedule:run
, this command must execute at configured time the commands that are listed in the functionschedule
– juniorb2ss
receive this message: No scheduled.
– alexjosesilva
Oxe, because there is not. See that one is configured to run only at 15:00, and another every day at midnight.
– juniorb2ss
as I register my command ?
– alexjosesilva
Your command is already registered. You have scheduled two commands to be executed, what you need to do is put the command
php artisan schedule:run
to be rotated every minute in the cron.– juniorb2ss
how do I do that ?
– alexjosesilva
https://stackoverflow.com/questions/5398014/using-crontab-to-execute-script-every-minute-and-another-every-24-hours
– juniorb2ss
insert the comondo here : protected $Commands = []
– alexjosesilva
error still persists !
– alexjosesilva
What error persists? No error.
– juniorb2ss
No scheduled Commands are ready to run.
– alexjosesilva
I told you. There are no commands to execute now. You have determined that the command
inspire
be executed every day at 3:00 PM, NOW IT’S NOT 3:00 PM, and the other command has ordered that you be executed every day at MIDNIGHT, now it’s not midnight either.– juniorb2ss
I changed the time to 15:20, 15:30 and 16:00, 16:20, 16:30 and nothing was executed
– alexjosesilva
continues displaying the message: No scheduled Commands are ready to run
– alexjosesilva