Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel Task Scheduling set to run every minute but it run only once

I am using Laravel Task Scheduling. I defined a custom command and set it to run every minute like:

$schedule->command('dailyk')->everyMinute();

Then I used the following command to run the task:

php /var/www/stockhit/artisan schedule:run 1>> /dev/null 2>&1

I used log to check that my custom command continued to run. However, it is not run every minute. Instead, it just ran once.

How can I make it run every minute, instead of just one time?

like image 586
alextre Avatar asked May 17 '16 02:05

alextre


1 Answers

you need to add a cron job. On ubuntu use the command

crontab -e

to open your cron job file, then add

* * * * * php /var/www/stockhit/artisan schedule:run 1>> /dev/null 2>&1
like image 171
jclyons52 Avatar answered Oct 06 '22 00:10

jclyons52