Summary
Add a native restic snapshot backend to bbackup for encrypted, deduplicating workstation backups. This should be first-class bbackup functionality, not a wrapper script around restic.
Motivation
A workstation backup profile needs encrypted deduplicating snapshots, automatic Git repository discovery, retired-repository protection, restore/check workflows, machine-readable output, and scheduler integration. Restic already provides the encrypted deduplicating repository layer; bbackup should own the profile model, discovery, safety rules, scheduling, state ledger, and CLI surface.
Proposed scope
- Add a native config area such as
snapshot_profiles.
- Add a
restic snapshot engine.
- Add bbackup commands for
snapshot init, snapshot run, snapshot check, snapshot restore, snapshot retire, snapshot purge-plan, and snapshot schedule.
- Support JSON output for planning, runs, health checks, purge plans, and restore/check operations.
- Support profile-level dependency checks in
bbman health, including restic, rclone, remote reachability, password file permissions, cache directory, hostname guard, and repository initialization.
- Support automatic Git repository discovery from configured repo homes, plus explicitly configured repo roots.
- Preserve retired/deleted repository snapshots by default; never run broad
restic forget across the whole profile repository.
- Maintain a bbackup state ledger of discovered repos, stable repo IDs/fingerprints, active/retired status, retirement time, and last successful snapshot IDs.
- Back up each discovered repo as its own restic snapshot with tags such as
bbackup, profile=<name>, scope=repo, and repo_id=<id>.
- Restrict automated retention to active repo IDs and configured non-repo scopes only.
- Require dry-run-first manual purge planning for retired repos before any destructive
forget/prune action.
- Provide restore and repository check commands suitable for smoke verification and scheduled maintenance.
- Provide schedule generation/install support, for example user systemd timers that call
bbackup directly.
- Include unit and integration tests for config parsing, command construction, discovery, retired-repo protection, purge safety, hostname guard, dependency health, local restic repo init/backup/check/restore, and path-reuse/fingerprint conflicts.
Acceptance criteria
- A native bbackup config can define a restic snapshot profile with repository URL, cache dir, state dir, password file, host ID, repo discovery roots, explicit roots, include paths, exclude paths, retention policy, and scheduling metadata.
- CLI commands exist for
snapshot init, snapshot run, snapshot check, snapshot restore, snapshot retire, snapshot purge-plan, and snapshot schedule.
- Commands support human-readable and JSON output where appropriate.
bbman health reports profile-specific dependency and readiness status.
- New Git repos under configured repo homes are included automatically without config edits.
- Deleted repos are marked retired and excluded from automated retention when they have at least one successful snapshot.
- Deleted repos without any successful snapshot produce a critical alert instead of being silently dropped.
- Path reuse with a different Git fingerprint is detected and blocks history merging until manually resolved.
- Automated retention never purges retired repos or runs broad profile-wide
forget operations.
- Manual purge requires a dry-run purge plan and explicit confirmation before destructive restic operations.
- Restore and check workflows are covered by integration tests using a temporary local restic repository.
- Scheduler generation supports daily backup, weekly maintenance, and monthly verification flows without overlapping runs.
Notes
For workstation backups using a cloud remote such as Google Drive through rclone, restic encryption is sufficient for content and metadata encryption. Additional rclone crypt wrapping should remain optional rather than required by the profile design.
Summary
Add a native
resticsnapshot backend to bbackup for encrypted, deduplicating workstation backups. This should be first-class bbackup functionality, not a wrapper script around restic.Motivation
A workstation backup profile needs encrypted deduplicating snapshots, automatic Git repository discovery, retired-repository protection, restore/check workflows, machine-readable output, and scheduler integration. Restic already provides the encrypted deduplicating repository layer; bbackup should own the profile model, discovery, safety rules, scheduling, state ledger, and CLI surface.
Proposed scope
snapshot_profiles.resticsnapshot engine.snapshot init,snapshot run,snapshot check,snapshot restore,snapshot retire,snapshot purge-plan, andsnapshot schedule.bbman health, includingrestic,rclone, remote reachability, password file permissions, cache directory, hostname guard, and repository initialization.restic forgetacross the whole profile repository.bbackup,profile=<name>,scope=repo, andrepo_id=<id>.forget/pruneaction.bbackupdirectly.Acceptance criteria
snapshot init,snapshot run,snapshot check,snapshot restore,snapshot retire,snapshot purge-plan, andsnapshot schedule.bbman healthreports profile-specific dependency and readiness status.forgetoperations.Notes
For workstation backups using a cloud remote such as Google Drive through rclone, restic encryption is sufficient for content and metadata encryption. Additional
rclone cryptwrapping should remain optional rather than required by the profile design.