docker-crontab icon indicating copy to clipboard operation
docker-crontab copied to clipboard

Configuration cleanup/jobs clean up

Open psyciknz opened this issue 3 years ago • 1 comments
trafficstars

Is there a method for controlling how the config.working.json is updated, cleaned up after editing the config.json/yml?

And same with the jobs folder, this seems to hold a lot of script files that do not seem to get cleaned up. Unsure if there's a method for doing this.

psyciknz avatar Jul 27 '22 01:07 psyciknz

@psyciknz this was buggering me too

i've found a quick workaround, just point the HOME_DIR variable to a tmpfs mount and on every container restart the folder will clear out and regenerate the latest crontabs

in docker-compose just modify like this:

   ....
   environment:
      HOME_DIR: "/crontab"  # <-- this can be (almost) anything but it needs to also match the config.json/yml path below
    volumes:
      - type: tmpfs
        target: /crontab
      - "/var/run/docker.sock:/var/run/docker.sock:ro"
      - "/opt/crontab/config.yml:/crontab/config.yml:rw"  # <-- important for this to be AFTER the tmpfs mount
    ....

peterbuga avatar May 02 '23 07:05 peterbuga