Skip to content

Instantly share code, notes, and snippets.

@dteoh
Last active February 1, 2017 11:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dteoh/6253aae8564dfeeaf1e4 to your computer and use it in GitHub Desktop.
Save dteoh/6253aae8564dfeeaf1e4 to your computer and use it in GitHub Desktop.
Checksumming backups

par2 is not just for checksumming and recovering Usenet binaries, you can use it for your backups as well.

In my case, I wanted to make sure my RAW and JPG files don't get corrupted by bitrot.

Generating the checksum:

$ cd /the/directory/where/files/are/kept
$ par2 c something.par2 *
$ shasum -a 256 * > shasum256.txt

By default, the checksum files can recover up to 5% of data corruption.

To increase the amount of recovery data, for example by 20%:

$ par2 c -r20 something.par2 *

Verifying the files:

$ cd /the/directory/where/files/are/kept
$ shasum -a 256 -c shasum256.txt
$ par2 v something.par2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment