Just curious if there is an easy way to back up my docker-compose.yaml and .env files. I have the following directory structure for my containers:
-docker
-<name of container>
-.env
-docker-compose.yml
I’d like to copy those two files for each container folder but no other subfolders that may also be in the container folder (config, data, etc). I’ve been trying to get my restic backups to do it but I just can’t figure it out.
Is there a better way? I’d like to have backups in case my entire server dies.
UPDATE: Thank you all for the advice, I’m giving git a try and so far so good!
I mean… just back them up like any other file. If you want them and nothing else, then do an exclude all and then include after for those files.
But you also need to backup the rest of the data, so I’m not sure why you’d want to exclude all the other folders.