I am trying to set up scheduler in Laravel.
Here is my crontab which I debugged and works fine - atleast with my cron job
* * * * * /bin/echo "foobar" >> /my_path/example.txt
* * * * * php /var/www/myproject/artisan schedule:run 1>> /dev/null 2>&1
protected function schedule(Schedule $schedule)
php artisan inspire
This part just puts the output into oblivion so you'll never see it:
>> /dev/null 2>&1
Why not try:
* * * * * php /var/www/myproject/artisan schedule:run >> /my_path/example.txt
And check to see if the cron is run in /my_path/example.txt
The default inspire command essentially just echo's a quote so the only way to see it in a cron is to output it to a file on the server.
You can do this using something similar to this:
Further details: https://laravel.com/docs/5.4/scheduling#task-output