Cloning a repository to another location?


Is there a best practise way to clone a restic repository to another location?

My scenario is that I currently backup all machines to a local server via SSH and then clone that backup to a different location with rsync as a desaster insurance.

I now want to do the backups using restic and I’m guessing that rsyncing a repo every night is not the cleverest way as rsync doesn’t understand what’s going on inside the repo. As far as I can see there is no function in restic to do that other than have the clients do two backup runs, right?

Any tipps? Thanks!



restic will not update any existing files in the repo, so it should work nicely together wir rsync and not copy any data twice. But it might also propagate errors to the second copy, so it might be a good idea just to run a second backup instead nonetheless.



Hello @nicnab.

When it comes to restic repo, rsync can actually do a pretty good job, when syncing it to different location.

Restic backup will only add to the repo, rsync will detect it and transfer what is new. When you run prune, some packs will be rewritten, and some deleted. Again, rsync can detect all these changes, transfer what has changed and delete what is gone (with --delete flag, of course).

So, I don’t see any inefficiencies there.

Personally, I’m using rclone sync to replicate restic repo to cloud storage, and it has also been working very good since implemented.



Sounds great! I will use rsync then. Errors in the repository must be avoided in the first place anyway and the cloning only takes place weekly anyway.

Thank you for your help!