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

@@ -57,9 +57,10 @@ class BackupRunAdmin(admin.ModelAdmin):
@admin.register(SnapshotRecord)
class SnapshotRecordAdmin(admin.ModelAdmin):
list_display = ("host", "kind", "dirname", "status", "started_at")
list_filter = ("kind", "status", "started_at")
list_display = ("host", "kind", "dirname", "status", "started_at", "discovered_at")
list_filter = ("kind", "status", "started_at", "discovered_at")
search_fields = ("host__host", "dirname", "path")
readonly_fields = ("discovered_at",)
@admin.register(ScheduleConfig)