I've created a command to send automatic emails. When I do homestead ssh
and I run php artisan emails.send
an email arrives in my mailtrap.io account.
I've added this code to the kernel.php
$schedule->command('emails:send')->everyFiveMinutes();
I've put it at a 5 minute interval, just to make it easier to quickly test it. I've ssh'd into Homestead and performed
php /home/vagrant/Code/soeptime/artisan schedule:run 1>> /dev/null 2>&1
then I exit
homestead and I did homestead provision
However, there is nothing in the logs and I still haven't received an email, homestead is now running for more then 15 minutes.
Crontab might fail for a variety of reasons: The first reason is that your cron daemon might not be working for any reason, resulting in your crontab failing. There also exists a possibility that your system's environment variables are not settled correctly.
It is a wildcard for every part of the cron schedule expression. So * * * * * means every minute of every hour of every day of every month and every day of the week .
The cron reads the crontab (cron tables) for running predefined scripts. By using a specific syntax, you can configure a cron job to schedule scripts or other commands to run automatically.
You need to manually edit crontab:
First:
crontab -e
and then add
* * * * * php /home/vagrant/Code/soeptime/artisan schedule:run
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With