I’m trying to use rclone as a backup solution by rclone’ing every night…
I have a docker container that works if I run it with bin/bash. then I can use commandline to do rclone…
but if I don’t run the container to bin/bash then it exits immediately.
Is there a way to either:
a: start the existing container and then run my command (preferably in a single line)
or
b: create a container, run my command, delete the container (this would be in a script I guess )
can someone guide me to achieve the above so I can run it every night
I think the setup you’re looking for is one where whatever data the container has that needs to be backed up or persisted is stored in the host filesystem (using the docker run -v option). You should try to plan things so that, if you lose your entire /var/lib/docker directory (maybe you moved hosts, things break sometimes too) you don’t actually lose any data.
That having been said: why doesn’t it work to run whatever your backup command is in the “command” position of the docker run command (e.g., where you do or don’t put bash)?