How to create par2 parity files for a Restic repository

I would like to generate parchive par2 parity files for long-term storage of a restic repository. This helps to recover from errors in case repository is corrupted. Restic currently doesn’t have error correction feature (Duplicity is the only backup app that generates par2 files AFAIK).

Does anyone know what’s the best way to create these par2 files? Should I write a bash script to recursively create par2 files for each file in the restic depository? Or should I generate a tar file from the whole restic repository and then create Par2 files for that one file? But this increases the required space by factor 2 since tarball must be saved too (a tarball generated 10 years later from the same repository may not be same as today’s tarball due to software updates).

Anyone has dealt with error correction with Restic?

2 Likes

That’s the way I do it. It means that it’s nice and quick to make par2 files for the newest additions after each backup (just find any recently-created files). I don’t tend to prune much, so am happy for the odd par2 file to hang around even when the corresponding restic file has been deleted. Otherwise, just make a script to delete the unused par2 files after a prune operation.

In order to avoid making a mess in my repo directory (although I don’t think restic would care if I did), I have a corresponding directory tree just for the par2 files.

My scripts are rather amateurish, and proper engineers would probably balk at them. Happy to share if needed, but it would be better to have more elegant examples in the forum if anyone has any? :slight_smile:

2 Likes