Brck

Posted on

I’ve just released Brck, a simple bit rot checker for legacy file systems. It records and compares the modification times and cryptographic hash sums of regular files. When a file’s hash changed but it’s modification time did not, then Brck reports the file as corrupted so you have a chance to restore the file from backup. You do have backups, right? 😉

You can find the source code here. What follows is an excerpt from the README.

Installation #

Brck is available on crates.io. You can install it using Rust’s package manager Cargo.

$ cargo install brck

Usage #

Without any options, Brck will record all regular files in current working directory recursively and write those records to a gzipped .brck file.

$ brck

When you run the same command again, Brck will compare the recorded files against the current file system and report any corrupted files.

$ brck
corrupted: ./test_file
Error: Found 1 denied difference

Brck is quiet by default. Increase the verbosity using -v or request a summary using -s. Alternatively, enable the JSON output using -J and perform your own post-processing, e.g., using jq:

$ brck -vvJ | jq -sr 'group_by(.type)[] | [.[0].type, length] | @tsv' 2>/dev/null
added   4
corrupted       1
unchanged       1219

See the built-in help for all supported options:

$ brck --help

Features #

Limitations #

See also #