From b26fb40cbc70f6e20ca03abad466203d43ecdaac Mon Sep 17 00:00:00 2001 From: Hitonabi Date: Fri, 17 Jul 2026 16:55:28 +0200 Subject: [PATCH] Restore-Probe: --ignore-ownership (Erstlauf-Befund) + Tarball-Grep nur Dateien Erstlauf fand echten Stolperstein: pxar-Restore extrahiert als User korrekt, scheitert aber am chown root-eigener Dateien (llamaswap) -> Fehl-Exit trotz intakter Daten. Restore-Aufrufe jetzt mit --ignore-ownership/--ignore-acls (uns interessiert der INHALT); llamaswap-Fallback prueft den Inhalt statt des Exit-Codes. Kern-Datei-Grep matcht nur noch Dateien, keine Verzeichnisse. Co-Authored-By: Claude Fable 5 --- deploy/restore-probe.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/deploy/restore-probe.sh b/deploy/restore-probe.sh index 5a1c5b1..b59fe46 100644 --- a/deploy/restore-probe.sh +++ b/deploy/restore-probe.sh @@ -78,8 +78,11 @@ print(round(alter_h, 1)) fi # Selektives Canary-Restore aus hermes.pxar mkdir -p "$TMP/pbs" + # --ignore-ownership/-acls: als User kann chown auf fremde Eigentümer nicht + # gelingen (sudo-frei ist Absicht) — uns interessiert der INHALT, nicht das chown. if "$PBS_BIN" restore "$SNAP" hermes.pxar "$TMP/pbs" \ - --pattern "state/backup-canary.txt" >/dev/null 2>&1 \ + --pattern "state/backup-canary.txt" \ + --ignore-ownership true --ignore-acls true >/dev/null 2>&1 \ && [ -f "$TMP/pbs/state/backup-canary.txt" ]; then if [ "$(cat "$TMP/pbs/state/backup-canary.txt")" = "$CANARY_SOLL" ]; then BEFUND+=("PBS-Restore: Canary aus hermes.pxar wiederhergestellt, Inhalt EXAKT korrekt ✅") @@ -89,8 +92,9 @@ print(round(alter_h, 1)) else # Erstlauf-Fallback: winziges llamaswap.pxar komplett mkdir -p "$TMP/ls" - if "$PBS_BIN" restore "$SNAP" llamaswap.pxar "$TMP/ls" >/dev/null 2>&1 \ - && [ -s "$TMP/ls/config.yaml" ] && grep -q 'models:' "$TMP/ls/config.yaml"; then + "$PBS_BIN" restore "$SNAP" llamaswap.pxar "$TMP/ls" \ + --ignore-ownership true --ignore-acls true >/dev/null 2>&1 || true + if [ -s "$TMP/ls/config.yaml" ] && grep -q 'models:' "$TMP/ls/config.yaml"; then BEFUND+=("PBS-Restore: llamaswap.pxar wiederhergestellt, config.yaml plausibel ✅ (Canary war noch nicht im Snapshot — ab dem nächsten dabei)") else FEHLER+=("PBS-Restore FEHLGESCHLAGEN: weder Canary noch llamaswap.pxar sauber wiederherstellbar") @@ -118,7 +122,7 @@ else FEHLER+=("Tarball-Restore: Canary im Archiv, aber Inhalt WEICHT AB") fi else - KERN="$(tar -tzf "$TARBALL" 2>/dev/null | grep -E 'cron/|state/' | head -1 || true)" + KERN="$(tar -tzf "$TARBALL" 2>/dev/null | grep -E '(cron|state)/[^/]+$' | head -1 || true)" if [ -n "$KERN" ] && [ -n "$(tar -xzf "$TARBALL" -O "$KERN" 2>/dev/null | head -c 1)" ]; then BEFUND+=("Tarball-Restore: Kern-Datei ($KERN) herausgezogen, nicht leer ✅ (Canary ab der nächsten Sicherung dabei)") else