How to run a cron job inside a docker container?

前端 未结 20 1713
無奈伤痛
無奈伤痛 2020-11-22 05:36

I am trying to run a cronjob inside a docker container that invokes a shell script.

Yesterday I have been searching all over the web and stack overflow, but I could

20条回答
  •  生来不讨喜
    2020-11-22 06:23

    So, my problem was the same. The fix was to change the command section in the docker-compose.yml.

    From

    command: crontab /etc/crontab && tail -f /etc/crontab

    To

    command: crontab /etc/crontab

    command: tail -f /etc/crontab

    The problem was the '&&' between the commands. After deleting this, it was all fine.

提交回复
热议问题