2017-03-07 2 views
1

그래서 저는 매일 2시에 명령을 실행하도록 커널 파일을 설정했습니다. 워드 프로세서에 의해 제안크론 작업이 실행되고 있지 않습니다. Laravel 5.3

class Kernel extends ConsoleKernel 
{ 
/** 
* The Artisan commands provided by your application. 
* 
* @var array 
*/ 
protected $commands = [ 
    Commands\Users\MyCommand::class 
]; 

/** 
* Define the application's command schedule. 
* 
* @param \Illuminate\Console\Scheduling\Schedule $schedule 
* @return void 
*/ 
protected function schedule(Schedule $schedule) 
{ 
    $schedule->command(Commands\Users\MyCommand::class) 
     ->dailyAt('02:00'); 
} 
} 

또한 명령 줄에서 이것을 실행 한 :

* * * * * php /path/to/artisan schedule:run >> /dev/null 2>&1 

내가 명령 줄에서 명령이 실행을 'MY 명령 이름 장인 PHP'를 실행할 때. 또한, 일정을 사용할 때 : 정확한 시간에 명령이 실행됩니다.

그러나 지정된 시간에 자동으로 실행하고 싶습니다. 이는 발생하지 않습니다.

답변

0

/path/to/artisan은 Artisan의 실제 경로 여야합니다. 보통 /home/myUser/laravel/artisan 또는 Laravel/Artisan이 설치되어있는 곳이면 어디든됩니다.

1

당신은 당신의 cron 작업을 편집하려면

* * * * * php /path/to/artisan schedule:run >> /dev/null 2>&1 

, 먼저이 명령을 입력하여 cron 작업에이 명령을 추가 할 필요가

crontab -e 
관련 문제