I would suggest to run cron from console. Install crontab https://help.ubuntu.com/community/CronHowto on your machine and schedule it there instead of laravel. This is something that you want to be sure 1000% it works.
send email every minute using cron job
I have the following function:
protected function schedule(Schedule $schedule)
{
$schedule->command('email:users')->everyMinute();
}
when I ad the command
php /home/rain/artisan schedule:run 1>> /dev/null 2>&1
to cpanel as a cron job it works but it doesn't send me a notification email. Cpanel suppose to email me a notification when the cron job runs, but I haven't receive a single email.
I found out that /dev/null 2>&1 is used in cron job when you do not want to send email when cron job runs. So, what the command should be exactly to get emails from cpanel when it runs the cron job?
Also when I run the command artisan schedule:run from shell it runs it only once. I am very curious why do I have to add ->everyMinute(); if it is not going to run every minute? If I want to send it weekly I can setup the cron job. Why do I have to write to add ->weekly(); in the function if cron job is sending it weekly?
Please or to participate in this conversation.