Posit the following scenario: I have a restic repository locally on a NAS, but I want it mirrored to B2.
I think ideally what I’d want is something that looked like…
restic mirror --from-repo local --to-repo b2 $snapshot
And this would compare the blobs on both sides and simply move the blobs necessary to make $snapshot complete on the target host. After the command was finished, the snapshot in local would appear in b2.
I realize this is possible with mount or some creative scripting but this way seems the most airtight and least prone to error, also most other solutions I can think of would require rehashing the files.
…oh wait, this doesn’t work because each repo has its own polynomial for the Rabin fingerprints, right?
Right, but just copying the files won’t work, because repos initialize their content defined chunking differently, no two repos will ever agree on the Rabin fingerprint for a given bytstream. The data has to go through and entire restore process and then backup again, so maybe this ask isn’t practical.
Well, suppose the files that live in the snapshot I’m trying to export aren’t on my drive anymore, like I’m trying to move historical snapshots that live only on the backup.
Or I’m trying to do the export with an agent that doesn’t have access to the original files, like a cloud server process somewhere that can’t just ssh into my office machine and kick off restic. Or, relatedly, my office system is switched off or unavail.