I added following line in Console/Kernal
protected function schedule(Schedule $schedule)
{
$schedule->command('queue:work')
->everyMinute()
->appendOutputTo($filePath);
}
Then in cmd prompt I ran the following artisan command to run the scheduled tasks but I get following error
php artisan schedule:run
Error:
[Symfony\Component\Debug\Exception\FatalErrorException]
Call to undefined method Illuminate\Console\Scheduling\Event::appendOutputTo()
Where as when I use ->sendOutputTo($filename)
instead it works fine, of course it doesn't append but overwrite a file.
Thanks,
K
Well one of the way can test if Schedule is running you can dump anything to log file. Log::info('Schedule Running '. \Carbon\Carbon::now()); After that you can grep the message from Logs.
To achieve this, Cron uses the specific configuration file called 'crontab', also known as 'Cron Table', to manage the scheduling process. Cron jobs are composed of two parts, the Cron expression, and a shell command that needs to be run. Cron expression is used for setting the schedule frequency.
The scheduler allows you to fluently and expressively define your command schedule within your Laravel application itself. When using the scheduler, only a single cron entry is needed on your server. Your task schedule is defined in the app/Console/Kernel.php file's schedule method.
Yes, I was right, appendOutputTo() isn't present in Laravel 5.1.
Good news is it will be available in Laravel 5.2
laravel-news-5.2-whats-coming
Update: 10-Dec-2015
as sstarlight mentioned, and I rechecked (searched for appendOutputTo function), and yes it is now present in vendor/laravel/framework/src/Illuminate/Console/Scheduling/Event.php
unlike before.
Thanks laravel and thanks sstarlight to let us know.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With