Skip to content

harn backup

harn backup <subcommand> [options]

Wraps restic with sensible defaults so single-user use doesn’t require remembering env vars. Repo + password file live under XDG-style paths and are initialized on first harn backup init.

Override via env (HARNERY_RESTIC_REPO, HARNERY_RESTIC_PASSWORD_FILE) or by editing the config file. The wrapper doesn’t abstract restic away; it sets defaults and passes the rest of restic’s flags straight through.

harn backup init # one-time: create repo + password file
harn backup snapshot # restic backup of .harnery/
harn backup list [--json] # restic snapshots
harn backup restore <id> # restic restore
harn backup prune [--dry-run] # restic forget + prune
harn backup check # restic check (integrity)
Setting Default
Repo ~/.cache/harnery/restic-repo
Password file ~/.config/harnery/restic-password (chmod 600, autogenerated)
Target .harnery/ from the cwd walk-up
Exclusions events.ndjson, .lock, .log.lock, artifacts/ (machine-local or short-lived)
Retention keep-daily 7, keep-weekly 4, keep-monthly 6
Terminal window
# First-time setup
harn backup init
# Daily snapshot (e.g. via cron)
harn backup snapshot --tag daily
# List what's in the repo
harn backup list --json | jq
# Restore a specific snapshot
harn backup restore 1a2b3c4d --target ./recovered
# Clean up old snapshots per the default policy
harn backup prune
# Verify repo integrity
harn backup check

harn backup snapshot accepts standard restic flags after the wrapper’s options:

Terminal window
harn backup snapshot --tag manual --target /custom/path --include-events --include-artifacts

--include-events and --include-artifacts override their default exclusions when you intentionally want a full archival snapshot.