feat: discover snapshots into Django records

Add a Django-native snapshot discovery service and management command
that scans backup directories, reads snapshot metadata, and idempotently
upserts SnapshotRecord rows. Expose it through the pobsync command
wrapper, update admin/docs, and cover discovery behavior with tests.
This commit is contained in:
2026-05-19 05:18:01 +02:00
parent e564262c72
commit 336fb1a5be
7 changed files with 214 additions and 2 deletions

View File

@@ -74,6 +74,12 @@ pobsync retention <host>
pobsync retention <host> --apply --yes --max-delete 10
```
Discover snapshots already present on disk:
```
pobsync discover-snapshots --host <host>
```
The `pobsync` executable is a thin wrapper around Django management commands. Direct Django access is also available:
```
@@ -143,6 +149,7 @@ The remaining internal engine code still contains reusable backup primitives:
Next refactor targets:
- Record discovered snapshots into `SnapshotRecord`.
- Surface `SnapshotRecord` data through API/admin views instead of filesystem inspection.
- Move more snapshot lifecycle details into typed domain objects.
- Replace remaining dictionary-shaped config at engine boundaries.
- Remove legacy YAML import/export once production migration no longer needs it.