Laravel Cron Not Running at Same time

Viewed 81

I had make severals commands for my application like this :

protected $commands = [
    'App\Console\Commands\GraphAll',
    'App\Console\Commands\theBar',
    'App\Console\Commands\theVar',
    'App\Console\Commands\theDay',
    'App\Console\Commands\theVarDay',
    'App\Console\Commands\MailSend',
    'App\Console\Commands\Daily',
    'App\Console\Commands\DailyGraph',
    'App\Console\Commands\CongloBar',
    'App\Console\Commands\CongloAll',
    'App\Console\Commands\CongloVar'
];

They all work good. I call the schedule run at midnight and i receive notifications for all the commands who are in this fonction :

protected function schedule(Schedule $schedule)
{
    //la cron de la barre
    $schedule->command('graph:All')
        ->everyMinute()
        ->sendOutputTo('app/Http/Crons/BarreCron');

    //La Cron du premier
    $schedule->command('bar:All')
        ->everyMinute()
        ->sendOutputTo('app/Http/Crons/OneCron');

    //La Cron du deuxième
    $schedule->command('var:All')
        ->everyMinute()
        ->sendOutputTo('app/Http/Crons/TwoCron');

    //La Cron du troisème
    $schedule->command('day:All')
        ->everyMinute()
        ->sendOutputTo('app/Http/Crons/ThreeCron');

    //La Cron du quatrième
    $schedule->command('varDay:All')
        ->everyMinute()
        ->sendOutputTo('app/Http/Crons/FourCron');
}

I wait one hour and run and an other script for launch a command who are not in this function , and i receive a notifications too.

But i have noticed , that when i call the schedule run , it run all the commands ; not only who they are in the fonction. And i want separate the execution between them.

Is there a way to run only the 5 commands ,and skip the others for an other script?

1 Answers
Related