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.
Subcommands
Section titled “Subcommands”harn backup init # one-time: create repo + password fileharn backup snapshot # restic backup of .harnery/harn backup list [--json] # restic snapshotsharn backup restore <id> # restic restoreharn backup prune [--dry-run] # restic forget + pruneharn backup check # restic check (integrity)Defaults
Section titled “Defaults”| 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 |
Examples
Section titled “Examples”# First-time setupharn backup init
# Daily snapshot (e.g. via cron)harn backup snapshot --tag daily
# List what's in the repoharn backup list --json | jq
# Restore a specific snapshotharn backup restore 1a2b3c4d --target ./recovered
# Clean up old snapshots per the default policyharn backup prune
# Verify repo integrityharn backup checkPass-through
Section titled “Pass-through”harn backup snapshot accepts standard restic flags after the wrapper’s options:
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.