1

can you help me please to comprehend how to run Laravel 5.2 scheduling on Win 10? I have created Windows task according this http://ss64.com/nt/schtasks.html

SCHTASKS /Create /SC minute /TN Test2 /TR C:\Apache24\htdocs\example-laravel\win_cron.bat

It has been successfully created. Also I have created .bat file according this link Laravel 5.1 Task Scheduling on Windows

cd c:\Apapche24\htdocs\example-laravel
php artisan schedule:run 1>> NUL 2>&1

In App\Console\Kernel class I have:

protected function schedule(Schedule $schedule)
{
    $schedule->call( function()
    {
        Log::info( 'Some test message from   App\Console\Kernel:schedule.' );
    })->everyMinute();

}

It seems task is triggering every minute, but there is nothing in log. Also it returns 0x1 to the Task Scheduler window as last run result. If I run schedule:run via console it works as I expect. Any idea how to force it to work?

Thanks.

Community
  • 1
  • 1
Čamo
  • 3,863
  • 13
  • 62
  • 114

1 Answers1

0

As I found out here Run a batch file with Windows task scheduler it is necessary to set up "Start in" option in Windows Task scheduler in action tab of the task. So it is not necessary to create task via command line.

Community
  • 1
  • 1
Čamo
  • 3,863
  • 13
  • 62
  • 114