-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cron job not running #27
Comments
My original case turned out not to be working for a number of other reasons which caused the cron job to fail so I am closing this. A lesson from this could perhaps be to make it easier to get error output from cron into the docker logs. |
Hey @kasperg ! I'm reopening your issue. I wrote a quick test and it seems indeed that output from cron is sent to docker logs, but not errors from cron. I'll look into it. |
Ok, this was not as easy to solve as I had expected (https://github.com/thecodingmachine/docker-images-php/pull/28/files#diff-3799b1f42986a8b0c3012d9bbb330537R28), but that's solved. Thanks for sharing your issue and taking the time to give some feedback! |
Thanks for sharing this. I wanted to try this out for a project but I am having problems getting cron jobs working.
Expected Behavior
When I set
CRON_COMMAND
andCRON_SCHEDULE
I expect the command to be executed as define by the schedule.Current Behavior
When these commands are set the
/etc/cron.d/generated_crontab
file seems to be generated as expected but as far as I can tell the command is not executed.I cannot tell why. Some form of logging might be helpful if possible.
Steps to Reproduce (for bugs)
docker-compose.yml
file:docker-compose up
docker-compose exec my_app cat /etc/cron.d/generated_crontab
. Output seems sensible enough* * * * * root (php -r "echo time();") | sed -e 's/^/[Cron] /' > /proc/7/fd/1 2>/proc/7/fd/2
Your Environment
php:7.2-v1-apache
andphp:7.2-v1-cli
The text was updated successfully, but these errors were encountered: