Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request / par2create] Option to regenerate par2 files *if input file changed* #170

Open
ronjouch opened this issue Feb 26, 2022 · 0 comments

Comments

@ronjouch
Copy link

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:

  1. Input file was more recently modified than the par2 files
  2. ... 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?

Thanks for par2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant