Backup multiple servers to one restic repo

Hi all.

Just started using restic for backups.

Need advice on my backup help, so i have multiple VMs, which i need backup docker volumes

example each VM will have a /opt/docker directory, and each docker container will have its own folder.

example
#VM 1
/opt/docker/uptime-kuma
/opt/docker/gitea
/opt/docker/n8n
/opt/docker/postgres

#VM 2
/opt/docker/piped
/opt/docker/mysql
/opt/docker/adgauard
 
#VM 3
/opt/docker/invoiceninja
/opt/docker/homepage
 
#VM 4
/opt/docker/caddy
/opt/docker/jellyfin 

I want to backup each /opt/docker directory into one restic repo, where the repo will be on NAS via NFS mount.

How can i achieve this? each host will have restic and nfs mount

restic -r path/to/repo backup /opt/docker

Hint 1: Backing up the data folder of a running MySQL instance is not a good idea. You want to either stop that service prior to backing up or, even better, make a database dump and back that up at the same time you backup the rest of the application files to make sure you have a consistant set of files that can be successfully restored. Which you regularily want to test anyway.

Hint 2: Consider using a single restic repo if you expect to be backing up the same data multiple times. That way you can enjoy the benefits of restic’s deduplication functionality and save a lot of space on the backup locations.

thanks for the reply

thanks for the hints, sure will stopping serivec prior to backup.

so just to confirm if backup to the same repo from different vms wont be a problem.

eg.

2:10am - vm 1 runs `restic -r /mnt/vmbackups/vmbp-repo backup /opt/docker/vm1``

2:20am - vm 2 runs `restic -r /mnt/vmbackups/vmbp-repo backup /opt/docker/vm2`

2:30am - vm 3 runs `restic -r /mnt/vmbackups/vmbp-repo backup /opt/docker/vm3`

2:40am - vm 4 runs `restic -r /mnt/vmbackups/vmbp-repo backup /opt/docker/vm4

thinking having theses set on the script unlock , check before each backup from each VM

That will work. Use one repo if deduplication is possible and wanted or multiple repos if you want to be able to, say, one day split repos to different drives. It depends on your use case.

thanks Nico for your input and opinion.

1 Like