Docker Standalone's Cron Notes #2184
-
Hi! I'm trying to get a completely working docker setup, but cron inside "php-resque" container is not working.
resque.sh have conditionals using (( )) sintaxis and use "<", but will be correct uses [ ] and -lt ?
|
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 3 replies
-
All works here :) so that one you will have to figure out |
Beta Was this translation helpful? Give feedback.
-
As for initial reboot cronjob it most likely bug, but there is cronjob which runs every minite. So php resque has to start in any case. Cronjobs has their own dedicate docker instance. They are not running on php-fpm So in any case there some problems in your setup :) |
Beta Was this translation helpful? Give feedback.
-
The fastest and clean way to resolve without have to rebuild any images or modify nothing was add this to docker compose: command: bash -c 'echo "$$(cat /etc/cron.d/lhc)" >> /etc/crontab && cron -f' We adds this line for docker compose's services "php-cronjob" and "php-resque" Now all works and runs cron jobs as expected! |
Beta Was this translation helpful? Give feedback.
-
That's not a correct solution
And if you looked here cronjobs are added during image build
And from where you took Is php resque working fine you can check by. PHP-Resque
After container has started if you wait few minutes you should see some
Basic cronjobsTo check is basic cronjobs is running you can check by
And default lhc cronjobs writes their log to E.g
You will always see empty crontab file on both images by default, becase we don't use it! |
Beta Was this translation helpful? Give feedback.
The fastest and clean way to resolve without have to rebuild any images or modify nothing was add this to docker compose:
command: bash -c 'echo "$$(cat /etc/cron.d/lhc)" >> /etc/crontab && cron -f'
We adds this line for docker compose's services "php-cronjob" and "php-resque"
Now all works and runs cron jobs as expected!