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!

I am doing this and plan to add a ‘restic check’ or maybe even restic check -read-data’ test into my rsync script. If my local backup has any issues, I don’t want to overwrite my potentially clean remote backup!

In my case, my remote server is a small freeBSD box and I’m thinking about running periodic 'restic check’s on that box as well just to ensure all is well with my data. This would seem to be a real advantage of backing up to a physical machine as compared to cloud storage.


Good idea, yes. I’m doing this manually from time to time and so far didn’t come across any problems but it surely sounds better to automate and mail problems.

I backup everything into one repo daily, prune on sunday noon and rsync it all away every night. I get confused checking the pruning results but I guess once that has been running for a couple of months, I will see the pattern :sweat_smile:

At one point you should also try to restore your files and verify that it works. It would be horrible thinking that you’ve been backing up for months and then the data that you actually need is not there or there is some other issue. Testing backups is critical.

1 Like

Absolutely. Actually I recently used the backup to switch laptops and it worked very well!

1 Like