The Basics
chkbit does two things:
- create an index (hash/checksum) of your files when you know the data is good/correct.
- verify your files against the index when you want to know if your data is good/correct.
Because chkbit may not be around when you want to check your data way into the future, it only uses standard hash algorithms and file formats.
Modifications
Once you have created the first index, chkbit detects intentional updates (when you are adding/editing/deleting files) and updates its index. Any unintentional changes will be flagged as damage
.
Technically it uses the modification time:
- if the time changed (because you made an edit) or the file is new, it records a new hash
- otherwise, it will compare the current hash to the recorded value and report an error if they do not match.
Atom vs Split Mode
These define how chkbit handles your index for a directory and its subfolders.
In atom
mode, chkbit uses a single .chkbit-db
file to store all hashes (referred to as index):
- pro: it does not clutter your system with hidden index files
- con: you need to make sure to include
.chkbit-db
with your backup - con: when you move folders, the hashes do not move with them
- con: if the index is damaged, it affects all hashes (manual recovery possible)
In split
mode, chkbit creates a .chkbit
file for the hashes in every folder (unless ignored):
- pro: when you make a backup, even for partial backups, the correct hashes are also backed up
- pro: if one index is damaged, the others are still fine
- pro: when you move a directory, the index moves with it
- con: while hidden, the
.chkbit
files are present in every directory
Prefer atom mode for many small files and folders and use split mode to index larger media like a photo collection.