4

I am trying to execute two console commands.Below is my two commands in my Kernel.php

protected function schedule(Schedule $schedule)
{
    $schedule->command('users:get')->everyMinute();

    $schedule->command('users:update')->dailyAt('01:00');
}

When I run php artisan schedule:run, Only the command which is/are scheduled as everyMinute is scheduled.

Running scheduled command: '/usr/bin/php5' 'artisan' users:get > /dev/null 2>&1 &

If I change the dailyAt to everyMinute for the second command, both are scheduled as shown below

Running scheduled command: '/usr/bin/php5' 'artisan' users:get > /dev/null 2>&1 &

Running scheduled command: '/usr/bin/php5' 'artisan' users:update > /dev/null 2>&1 &

1
  • 1
    you are mentioning dailyAt('01:00'),so when your time will 01.00 and you run php artisan schedule:run that time this command will execute,otherwise not Commented Nov 30, 2015 at 12:13

1 Answer 1

0

php artisan schedule:run will run the scheduled commands, not list them.

So, if you run the scheduled commands before 01:00 the users:update command will not be scheduled yet and will not be ran.

Sign up to request clarification or add additional context in comments.

2 Comments

is there any artisan command for showing the list of sheduled commands
php artisan list will list all artisan commands, and there's none that list scheduled commands. What's your goal with this? If you want to check the schedules from the terminal you could just cat app/Console/Kernel.php. Or if you want to get fancy you could probably cobble together a shell script that gets only the relevant lines with with grep and head or maybe sed?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.