Laravel 5.1任务计划命令问题 [英] Laravel 5.1 Task Scheduling command issue
问题描述
我正在尝试执行两个控制台命令.下面是我的 Kernel.php
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');
}
当我运行 php artisan schedule:run 时,仅计划了被安排为 everyMinute 的命令.
When I run php artisan schedule:run, Only the command which is/are scheduled as everyMinute is scheduled.
正在运行的计划命令:'/usr/bin/php5''artisan'users:get>/dev/null 2>& 1&
Running scheduled command: '/usr/bin/php5' 'artisan' users:get > /dev/null 2>&1 &
如果我将第二条命令的 dailyAt 更改为 everyMinute ,则两者的安排都如下所示
If I change the dailyAt to everyMinute for the second command, both are scheduled as shown below
正在运行的计划命令:'/usr/bin/php5''artisan'users:get>/dev/null 2>& 1&
Running scheduled command: '/usr/bin/php5' 'artisan' users:get > /dev/null 2>&1 &
正在运行的计划命令:'/usr/bin/php5''artisan'users:update>/dev/null 2>& 1&
Running scheduled command: '/usr/bin/php5' 'artisan' users:update > /dev/null 2>&1 &
推荐答案
php artisan schedule:run
将运行计划的命令,而不列出它们.
php artisan schedule:run
will run the scheduled commands, not list them.
因此,如果您在01:00
之前运行计划的命令,则users:update
命令将不会被计划,也不会运行.
So, if you run the scheduled commands before 01:00
the users:update
command will not be scheduled yet and will not be ran.
这篇关于Laravel 5.1任务计划命令问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!