I’m using docker for a while on a mini Ubuntu Server system 24x7 with local storage.
To avoid data loss I’d like to establish an automation to backup the container volumes on my NAS (NFS and SMB) in the near future.
Is there any best practice/HowTo concerning backing up container volumes to a NAS?
Unfortunalety I’m no Linux-Specialist.
How would you do it without Docker? If it is about an NFS or SMB share, it is about general Linux question (maybe Windows if you have Windows file share). If it is a database that has a specific way to replicate or export /backup data, that is what you need to follow and not just backing up the volume. Also NFS will not be compatible or at least optimal for everything, but that is not Docker-related either.
Thanks a lot for your reply.
What is the “better” solution borg backup or tar?
I would stop all containers before backing up and make a backup to my NFS share.
I wrote a little script that stops a stack, does a tar-file file, then restarts stack. Repeat with next stack.
At the end, everything is copied to my NAS.
Logs of the procedure are send to Graylog.
This has been running for two years no and I am happy with it. (I never had to restore anything… )
As I am not good with Linux scripting, my script is probably a mess and nothing you would like to copy… (If you really want it, send me a personal note)