Skip to content

Command line

The pabaru command does everything the app does and is easy to script. Run pabaru --help or pabaru <command> --help for the full list of options.

Command What it does
pabaru encode Back up files and folders into a PDF or PNG pages for printing.
pabaru decode Restore files from scanned pages (PNG, JPEG, TIFF, BMP, PDF).
pabaru inspect Show information about one scanned page and a block quality map.
pabaru verify Test a backup without a printer: simulated print, scan and restore.
pabaru plan Propose layouts (page count, dot density, resilience) for your data.
Terminal window
# Back up to a PDF (A4, laser 600 dpi, 200 dpi dots, 20 % parity)
pabaru encode ./photos ./documents -o backup.pdf
# More resilient: survives losing a whole page, encrypted with a password
pabaru encode ./documents -o backup.pdf --survive-page-loss --encrypt
# Pages as PNG images (e.g. to print them yourself)
pabaru encode ./documents -o ./pages
# Let the optimizer choose the parameters for a profile
pabaru encode ./documents -o backup.pdf --profile archival --printer laser600 --scanner-dpi 600

The output is a PDF if -o ends in .pdf, otherwise a folder of PNG pages.

Option Meaning
--profile compact|balanced|archival Use the optimizer’s proposal (profiles); overrides the manual options below.
--printer laser600|laser1200|inkjet Printer type (for --profile).
--scanner-dpi N Optical resolution of the scanner you will restore with (default 600).
--paper a4|letter|WxH Paper size; custom size in millimetres, e.g. 210x297.
--margin MM Paper margin in millimetres (default 10).
--printer-dpi N Physical printer resolution for manual settings (default 600).
--dot-dpi N Dot density; must divide the printer resolution (default 200).
--fill PCT Dot size in % of the pitch (default 70).
--redundancy PCT Minimum parity in % of the data blocks (default 20).
--survive-page-loss Guarantee recovery after losing any one page.
--encrypt Encrypt; you are asked for the password twice.
--password-env VAR Read the password from an environment variable (for scripts; enables encryption).
--name TEXT Optional label stored on paper. Input names are never stored.
--level N zstd compression level 1–22 (default 19).
Terminal window
# Restore from scans — the order of the files does not matter
pabaru decode scan*.png -o ./restored
# Without -o: restore into the folder of the first scan
pabaru decode scan*.png
# Straight from a scanner's PDF
pabaru decode scan.pdf -o ./restored

Encrypted backups are detected automatically and you are prompted for the password (three attempts without reloading the scans). In scripts, use --password-env VAR.

Terminal window
# Check a single scan: page info and a map of block quality
pabaru inspect scan1.png

Useful to find out whether a page needs rescanning before you start a restore.

Terminal window
# Simulated print and scan, then restore and compare hashes — plus losing page 1
pabaru verify ./documents --survive-page-loss --drop-page 1
# Simulate crumpled and torn paper
pabaru verify ./documents --profile balanced --crumple medium --tear

verify accepts the same options as encode, plus the simulated damage: --angle DEG (rotation, default 1.5), --blur PX, --noise N, --scale R (scan vs. print resolution), --drop-page N (repeatable), --crumple medium|strong and --tear.

Terminal window
pabaru plan ./documents --printer laser600 --scanner-dpi 600 --paper a4
pabaru plan ./documents --json # machine-readable

plan packs the data and, for each of the profiles Compact, Balanced and Archival, computes the number of pages, dot density, minimum scan resolution and resilience. Add --encrypt to account for the few bytes encryption adds.

The CLI speaks English. (The desktop app is available in English and Czech and follows the system language; override it with PABARU_LANG=en or PABARU_LANG=cs.)