Skip to content
Advertisement

Linux scheduled task not working in Laravel

The below cronjob is not working, although the task itself is working when I manually run it using php artisan q:calc . I just added the path for php and artisan files as shown below, and pasted the command in the terminal. Am I missing something ?

* * * * * /usr/bin/php /var/www/html/sharp/artisan schedule:run >> /dev/null 2>&1

Advertisement

Answer

That command is a cron entry, not something you run in terminal.

For example, under the specific user you would run (depending on your environment):

$ crontab -e

And paste the above to the crontab file.

You can learn more in the docs: https://laravel.com/docs/master/scheduling

Or by researching how to add cron entries for your specific operating system.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement