Parbit documentation
Command reference
Every command, option and exit code
parbit.sh [options] [command] [args] Linux
parbit.bat [options] [command] [args] Windows
Without a command, Parbit opens the interactive menu when run in a terminal, and runs
update otherwise (from cron, scripts, pipes).
Commands
update [--rebuild]
Brings the parity in line with the folder:
| Found | Action |
|---|---|
| new file | creates its parity |
| edited file (size or timestamp changed) | creates fresh parity |
| same size, new timestamp | checks the content first: intact → only the timestamp is recorded; damaged after a time-zone shift → reported, parity kept |
| moved or renamed file | moves its parity folder (nothing recomputed) |
| deleted file | removes its parity, subject to the mass-deletion guard |
| file now ignored, empty or a symlink | removes its parity (no guard) |
--rebuild also redoes the parity of files created with a different REDUNDANCY.
Each of them is verified first: a damaged file keeps its old parity and is reported.
With -n, shows the plan without changing anything. In the menu, the plan is shown
and confirmed before starting.
verify [path…]
Checks files against their parity. Without paths it checks everything and records the
date as the last full verify. With paths (files or folders, inside parbit/ or
relative to it) it checks only those. In a terminal, if repairable damage is found,
Parbit offers to repair it right away.
Output per file, only when something is notable:
| Line | Meaning |
|---|---|
✘ DAMAGED (repairable) |
content differs from when it was protected; repair can fix it |
✘ DAMAGED (NOT repairable…) |
too much damage for the recovery data; restore from backup |
= timestamp changed, content intact |
only the time changed (time zone, touch); recorded |
~ modified since protected |
you edited the file; run update |
? deleted or moved |
the file isn't there; run update |
! par2 error |
par2 failed (see the message under it) |
repair [path…]
Like verify, and repairs every repairable file. The repaired content is written into
the existing file, so its name, permissions, owner, hard links and modification time
stay the same. With KEEP_DAMAGED=yes the damaged copy is kept in .parbit-quarantine/.
status
Summary: protected files and size, parity size, pending changes, ignored and empty
files, last update and verify, schedule, settings. With -v it also lists the
pending changes one by one.
auto
update, then repair (or only verify if AUTO_REPAIR=no). It's what scheduled
runs execute. If another instance is running, it exits quietly.
schedule [daily|weekly|monthly|off|status]
Runs auto periodically. Without an argument it shows the current schedule and, in a
terminal, lets you pick a new one.
| Linux | Windows | |
|---|---|---|
| mechanism | systemd user timer parbit-<id>.timer in ~/.config/systemd/user/ |
Task Scheduler task parbit-<id> |
| when | OnCalendar=daily/weekly/monthly (midnight; weekly = Mondays), up to 15 min later |
03:00; weekly = Sundays, monthly = every 4 weeks; up to 15 min later |
| missed runs | run at next boot (Persistent=true) |
run when possible (StartWhenAvailable) |
| priority | Nice=19, idle I/O |
low priority |
| drive missing | skipped (ConditionPathIsDirectory) |
the task ends with "file not found"; nothing else happens |
<id> is derived from the Parbit folder's path, so several Parbit folders can each
have their own schedule. status shows the last and next run.
config [key [value]]
Without arguments, lists all settings. With a key, prints its value. With a key and a value, changes it (keys are case-insensitive). See Settings.
ignore
Opens .parbitignore in your editor ($VISUAL, $EDITOR, otherwise nano; Notepad
on Windows) and, once you close it, says how many files are ignored and what the next
update will change. Outside a terminal it prints the file.
log [lines]
Shows the last lines of the activity log (default 40).
reset
Deletes all parity (.parbit/) after confirmation. Your files are not touched. Without
a terminal it requires -y.
menu, help
The interactive menu, and the built-in help.
Options
Options go before or after the command.
| Option | Effect |
|---|---|
-y, --yes |
answer yes to every question (reset, mass-deletion guard) |
-n, --dry-run |
update only shows what it would do |
-v, --verbose |
list every file (status, dry run, plans) |
-q, --quiet |
print only problems |
--no-color |
no colors (also with the NO_COLOR environment variable) |
-V, --version |
print the version |
-h, --help |
help |
Exit codes
| Code | Meaning |
|---|---|
0 |
all good |
1 |
damaged files found, all repairable (repair will fix them) |
2 |
unrecoverable files, or par2 errors |
3 |
usage or setup error (unknown command, invalid setting, par2 missing, another instance running) |
Useful in scripts: parbit.sh -q auto || notify-me "check the archive".
Settings
Stored in .parbit.conf next to the script. Change them with
parbit.sh config <key> <value> or from the menu (6).
| Key | Default | Values | Meaning |
|---|---|---|---|
REDUNDANCY |
20 |
1–100 | recovery data per file, in % of its size. Applies to new and edited files; update --rebuild redoes the rest |
NOTIFY |
problems |
all, problems, off |
desktop notifications |
KEEP_DAMAGED |
no |
yes, no |
keep damaged copies in .parbit-quarantine/ after a repair |
AUTO_REPAIR |
yes |
yes, no |
whether scheduled runs repair, or only verify and notify |
DELETE_GUARD |
50 |
1–100 | if at least this % of protected files vanished (and at least 5 files are protected), ask before dropping their parity |
VERIFY_REMIND |
180 |
0–3650 | remind when the last full verify is older than this many days; 0 turns it off |
JOBS |
1 |
1–64 | files verified in parallel. On an SSD with many small files try the number of CPU cores; on a hard disk keep 1 |
The environment variable PARBIT_REDUNDANCY overrides REDUNDANCY for one run.
Ignore list
.parbitignore, one pattern per line. Empty lines and lines starting with # are
skipped. Paths are relative to parbit/ and use / on every system.
| Pattern | Matches |
|---|---|
*.tmp |
every file named *.tmp, in any folder |
cache |
a file or folder named cache in any folder, and everything inside it |
videos/*.mkv |
.mkv files directly or indirectly under videos/ (* also crosses folders) |
drafts/ |
the folder drafts at any depth (a trailing / is ignored) |
*, ? and [abc] work as in shell globs. Matching is case-sensitive, on Windows too,
so that both systems protect the same files.
Never protected, whatever the list says: empty files, symbolic links (and Windows junctions), and files whose name contains a line break.
Files
All next to the script:
| Path | Content |
|---|---|
parbit/ |
your files |
.parbit/ |
the parity, one folder per file (see How it works) |
.parbit.conf |
settings |
.parbitignore |
ignore list |
.parbit.log, .parbit.log.1 |
activity log, rotated above 1 MB |
.parbit.state |
time and result of the last update and verify |
.parbit-quarantine/ |
damaged copies kept after repairs (KEEP_DAMAGED=yes) |
.parbit.lock |
prevents two runs at once |
.parbit.journal |
present only during a check of a moved file; lets the next run undo an interrupted rename |
.parbit.tmp/, .parbit.alias/ |
scratch folders, removed at the end of each run |
Menu keys
| Key | Action | Key | Action |
|---|---|---|---|
1 |
Update parity | 6 |
Settings |
2 |
Verify | 7 |
Ignore list |
3 |
Repair | 8 |
Schedule automatic checks |
4 |
Status (detailed) | 9 |
Activity log |
5 |
Verify a path | 0 |
Reset |
h |
Help | q, Esc |
Quit |