1
我有计划运行的工匠命令任务,每当我运行工匠命令是不论时间,我给cron作业执行每一次。cron作业
这里是我使用
class CronJobConsole extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'sms:note';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Command description';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
//executing function;
}
$this->info('Remainder SMS send successfully !!');
}
}
控制台,这是我的控制台/ kernel.php文件
class Kernel extends ConsoleKernel
{
protected $commands = [
\App\Console\Commands\Inspire::class,
\App\Console\Commands\FileEntryData::class,
\App\Console\Commands\CronJobConsole::class,
];
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
{
$schedule->command('sms:note')->dailyAt('19:00')->sendOutputTo('cronjob-result.php');
}
}
当我运行PHP的工匠短信:注意是执行每一次。我希望它在特定的时间执行,我有gven。
请帮我一把。
对服务器调度cron作业(或任务)有用的链接:https://technet.microsoft.com/en-us/library/cc748993(v=ws.11).aspx和http://www.cyberciti .BIZ/FAQ /怎么办,我加的作业对时钟守护下的Linux或UNIX的,操作系统/ – Tschallacka