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