I have a Symfony (PHP) command on Amazon Linux deployed to Elastic Beanstalk. I've added a cron job. All looks fine. The cron job runs, creates log file in /tmp folder but it's empty - there should be at least a few characters each time command is executed. I've seen a few posts here about running cron jobs but none of them worked - the closes to mine issue is this one.
The trick is that if I SSH to the instance and run this command manually all start working as expected. Cron runs the command every time it is set to run. But I need to run it for the first time manually, otherwise it won't be executed correctly.
I run PHP command through script.sh in which I have #!/bin/bash.
The question is why this needs to be run manually first and the it runs from cron. Otherwise it doesn't. I've set log file permissions to 0666 so anyone can write to it but no luck.
I deploy my Symfony command to Elastic Beanstalk. If I'd have only one EC2 instance that wouldn't be a problem, but I use Elastic Beanstalk to scale it and need it to run without manual initialization.
Any help appreciated. Thanks