简体   繁体   中英

laravel artisan command cron job is not working on ubuntu server

I am new to Ubuntu server and i install cron job and then make new cron job and no idea why its not working. My application is in Laravel so i have to run artisan command through cron job! When i am in project through root cmd artisan -command run properly but in cron did not run it.

here is my cron job listed

I check the if its running or not like this:

# sudo grep -i cron /var/log/syslog|tail -3

This is the output:

Jan 21 09:30:01 liedergut CRON[5222]:(root) CMD (/path/to/php/bin/php /var/www/html/artisan shows:fetchrss >> /dev/null 2>&1)

Jan 21 09:30:01 liedergut CRON[5223]: (root) CMD (php /var/www/html/artisan shows:fetchrss >> /dev/null 2>&1)

I am new to Ubuntu server and i install cron job and then make new cron job and no idea why its not working. My application is in Laravel so i have to run artisan command through cron job! When i am in project through root cmd artisan -command run properly but in cron did not run it.

here is my cron job listed

I check the if its running or not like this:

# sudo grep -i cron /var/log/syslog|tail -3

This is the output:

Jan 21 09:30:01 liedergut CRON[5222]:(root) CMD (/path/to/php/bin/php /var/www/html/artisan shows:fetchrss >> /dev/null 2>&1)

Jan 21 09:30:01 liedergut CRON[5223]: (root) CMD (php /var/www/html/artisan shows:fetchrss >> /dev/null 2>&1)

This command works for me

* * * * * cd /var/www/html/projectname && php artisan schedule:run >> /dev/null 2>&1

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM