cron - Cronjobs in Docker container how get them running? -
i've got cronjobs in debian docker container. don't start automatically why?
do have workarounds?
if running containers in docker, can add cron tasks on docker host machine execute commands in docker containers.
for example, run 'stress' application in container every 5 minutes can add following (substituting container id of course) crontab:
*/5 * * * * docker exec c78ddbed4ad9 /bin/sh -c 'stress -d 1 --hdd-bytes 64m --cpu 1 --io 2 --vm 2 --vm-bytes 64m --timeout 60s' >> /tmp/cronstress.log 2>&1
i running root user on docker host.
or run cron:
root@dockerhost:cron
Comments
Post a Comment