3e9c12eb75
Make the off-site snapshot protection a repeatable, monitored proof (DECISIONS 2026-06-11/-23): a read-only restore-test that lists .zfs/snapshot on the Storage Box, checks retention and newest-snapshot age, and SFTP-fetches one small file from the newest snapshot (size + SHA256). Connection is derived from the borg-ui repo URL and runs via docker exec borg-ui; no secret in the script, no write access. Wired into the run-restore-checks.sh dispatcher; runbook documents the pending one-time live validation. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
48 lines
2.3 KiB
Markdown
48 lines
2.3 KiB
Markdown
# Hetzner Storage Box Snapshot Restore - Runbook
|
|
|
|
Typ: Runbook · Stand: 2026-06-23 · Status: v1 (Live-Validierung ausstehend)
|
|
|
|
Belegt den Off-site-Schutz der Hetzner Storage Box. Append-only ist bewusst NICHT
|
|
umgesetzt (DECISIONS 2026-06-01); der Schutz ist snapshot-basiert (DECISIONS
|
|
2026-06-11): operative Borg-Creds koennen weiter `prune`/`compact`, die ZFS-
|
|
Snapshots der Box sind hostseitig nicht loeschbar (taeglich 05:30 UTC, Retention 7 Tage).
|
|
|
|
## Was der Test tut
|
|
|
|
`ops/restore-tests/hetzner-snapshot-restore-test.sh` (Dispatcher: `hetzner-snapshot`):
|
|
|
|
1. listet `.zfs/snapshot/` auf der Box (READ-ONLY, via SFTP aus dem `borg-ui`-Container)
|
|
2. zaehlt Snapshots (Retention) + prueft das Alter des neuesten aus dessen Namen
|
|
3. holt eine kleine Datei (`<repo>/README`) aus dem neuesten Snapshot, prueft Groesse + SHA256
|
|
4. loescht die Temp-Datei und schreibt einen Report nach `/mnt/user/backups/restore-reports/`
|
|
|
|
Verbindung (user/host/port/Repo-Verzeichnis) wird aus der in `borg-ui` konfigurierten
|
|
Borg-Repo-URL abgeleitet; SSH-Key + `known_hosts` liegen bereits im Container. Kein
|
|
Secret im Skript, kein Schreibzugriff, kein `prune`/`compact`.
|
|
|
|
## Manuell belegter Referenzlauf (2026-06-23, Codex)
|
|
|
|
- Box `u565255.your-storagebox.de`, `.zfs/snapshot` sichtbar
|
|
- Snapshots `2026-06-17`..`2026-06-23`, je `05:30` -> 7 Tage Retention
|
|
- neuester: `Automatic-2026-06-23T05-30-24`
|
|
- Probe `hetzner_borg_appdata_critical/README`, 73 B, SHA256 erzeugt, Temp geloescht
|
|
|
|
## Ausstehend: einmalige Live-Validierung
|
|
|
|
Das Skript ist nach den oben belegten Werten gebaut, aber noch nicht gegen die Box
|
|
gelaufen. Erstlauf:
|
|
|
|
```bash
|
|
bash /mnt/user/services/homelab-infra/ops/restore-tests/run-restore-checks.sh hetzner-snapshot --what-if
|
|
bash /mnt/user/services/homelab-infra/ops/restore-tests/run-restore-checks.sh hetzner-snapshot
|
|
```
|
|
|
|
Falls die Storage-Box-Shell die SFTP-`ls`/`get`-Form oder den `.zfs/snapshot`-Pfad
|
|
anders erwartet, ueber ENV justieren (kein Code-Change noetig):
|
|
`SNAPSHOT_DIR`, `PROBE_FILE`, `SNAPSHOT_NAME_GLOB`, `SNAPSHOT_SSH_OPTS`,
|
|
`MIN_SNAPSHOTS`, `MAX_SNAPSHOT_AGE_HOURS`. Bitte den tatsaechlich funktionierenden
|
|
SFTP-Aufruf aus dem manuellen Lauf gegenpruefen (Key/Identity, Port).
|
|
|
|
Nach erfolgreichem Erstlauf: in `schedule.md` aufnehmen (Vorschlag: monatlich,
|
|
analog Zufalls-Restore) und Status hier auf "aktiv" setzen.
|