I'm looking at using par2 on 7z archive files as an alternative to RAR's “recovery record”.
Unlike use cases I often see here on immutable data (e.g. photos, videos), the archives I want to protect are mutable and change frequently. Said differently: if using WinRAR with its “recovery record” option, updating the recovery record on archive change is automatically done by WinRAR (it’s “integrated”), but in par2-land to my knowledge there is no such automation when an par2-protected file is mutated, calling for an update of the par2 file. And so,
→ I'd like to tell par2create to “scrap existing par2 files and regenerate them, if the input file changed”. The word “changed" in the previous sentence would mean one of:
Input file was more recently modified than the par2 files
... or Input file size/checksum changed. Obvious caveat: corruption of checksum will mean an undesirable PAR2 scrap & re-create, so I'm not sure this 2. is such a great idea.
It could look like an extra -u : Update / regenerate PAR2 archive if input file changed , and on invoking par2create -u myfile.foo, it could look like:
If the input file was changed / is no longer properly protected by the .par2:
Running with option "-u", will update PAR2 files as needed.
- Detected myfile.foo as more recent than myfile.foo.par2 , regenerating par2...
Successfully regenerated myfile.foo.par2
Done updating PAR2 files, 1 PAR file(s) touched.
And if the .par2 file remains the most recent,
Running with option "-u", will update PAR2 files as needed.
No input file needed a PAR2 update, all PAR2 left untouched.
Alternatives
I guess I could do the same with a bit of scripting, but it'd be nice to have a built-in option.
Or is there a way to get the same end-result with existing options, but I missed it?
I'm looking at using par2 on 7z archive files as an alternative to RAR's “recovery record”.
Unlike use cases I often see here on immutable data (e.g. photos, videos), the archives I want to protect are mutable and change frequently. Said differently: if using WinRAR with its “recovery record” option, updating the recovery record on archive change is automatically done by WinRAR (it’s “integrated”), but in par2-land to my knowledge there is no such automation when an par2-protected file is mutated, calling for an update of the par2 file. And so,
→ I'd like to tell par2create to “scrap existing par2 files and regenerate them, if the input file changed”. The word “changed" in the previous sentence would mean one of:
It could look like an extra
-u : Update / regenerate PAR2 archive if input file changed
, and on invokingpar2create -u myfile.foo
, it could look like:If the input file was changed / is no longer properly protected by the .par2:
And if the .par2 file remains the most recent,
Alternatives
I guess I could do the same with a bit of scripting, but it'd be nice to have a built-in option.
Or is there a way to get the same end-result with existing options, but I missed it?
Thanks for par2.