Reputation:
I can't get my cron working on my local server using Valet. Here's what I've got/done.
php artisan command:mycommand
the command runs.php artisan schedule:run
the command runs.Output:
Running scheduled command: '/usr/local/Cellar/php70/7.0.13_6/bin/php' 'artisan' game:resources > '/dev/null' 2>&1 &
According to the Laravel docs it says to add this to my crontab.
* * * * * php /path/to/artisan schedule:run >> /dev/null 2>&1
When in my project directory, here is the pwd.
/Users/username/Projects/galaxywars
When I try crontab -e
in my laravel project root and save this:
* * * * * php /Users/myusername/Projects/projectname schedule:run >> /dev/null 2>&1
... it doesn't work. I've tried several variations of this cron command with no luck. Any idea what I'm doing wrong?
I'm on macOS using Valet.
Upvotes: 5
Views: 11580
Reputation: 1042
Under 10.13 (High Sierra) the only command that worked is:
* * * * * /usr/local/bin/php /Users/USER_NAME/PROJECTS_PATH/PROJECT/artisan schedule:run >> /dev/null 2>&1
Upvotes: 1
Reputation: 8880
You have to add artisan
add the end of the path. Try
* * * * * php /Users/myusername/Projects/projectname/artisan schedule:run >> /dev/null 2>&1
Upvotes: 13