I have a Laravel application running on EC2 instance handled by Elastic Beanstalk. To handle some cron job I used the script provided by AWS here https://github.com/awsdocs/elastic-beanstalk-samples/blob/master/configuration-files/aws-provided/instance-configuration/cron-leaderonly-linux.config And some extra informations provided by Macin in this thread Laravel Scheduling Task on AWS is not working
Everything is working exactly as they should on my staging environment, but in production the cron task doesn't seem to be triggered.
Both environnement are supposed to be exactly the same (platform version is "PHP 7.4 running on 64bit Amazon Linux 2").
I tried to run sudo service crond status
and I can see this line at the time I deployed the app (*system*) RELOAD (/etc/cron.d/cron_example)
.
Also in /var/log/cron
file I can see for everyminute (root) CMD (/usr/local/bin/cron_example.sh)
so it seems like everything is running fine, but /tmp/cron_example.log
isn't created and my real task isn't executed either.
Does anyone has an idea on what I could do to understand what is blocking it? Is there some extra log file I could consult to find out what is going on?
Thank you for your help.