restore.sh aktualisiert

main
sebastian.serfling 2026-03-18 13:21:43 +00:00
parent ae20a77ad3
commit 043c32f239
1 changed files with 9 additions and 5 deletions

View File

@ -2,7 +2,7 @@
# ============================================================================= # =============================================================================
# /opt/windmill-restore/restore.sh # /opt/windmill-restore/restore.sh
# Windmill Backup Restore Worker # Windmill Backup Restore Worker
# Version: 1.0.22 # Version: 1.0.23
# #
# Unterstützt sowohl VM (qm) als auch CT (pct) Backups. # Unterstützt sowohl VM (qm) als auch CT (pct) Backups.
# Backup-Typ wird automatisch aus dem Backup-Pfad erkannt (vm/ oder ct/). # Backup-Typ wird automatisch aus dem Backup-Pfad erkannt (vm/ oder ct/).
@ -565,11 +565,15 @@ if [[ "$BACKUP_TYPE" == "ct" ]]; then
pct stop "$VM_ID_RESTORED" 2>/dev/null || true pct stop "$VM_ID_RESTORED" 2>/dev/null || true
sleep 10 sleep 10
else else
qm shutdown "$VM_ID_RESTORED" 2>/dev/null || true # Graceful shutdown mit 2 Minuten Timeout, danach force-stop
sleep 30 qm shutdown "$VM_ID_RESTORED" --timeout 120 2>/dev/null || true
# Prüfen ob VM noch läuft → force-stop
if qm status "$VM_ID_RESTORED" 2>/dev/null | grep -q "running"; then
echo " VM läuft noch nach 120s force stop..."
qm stop "$VM_ID_RESTORED" --skiplock 1 2>/dev/null || true qm stop "$VM_ID_RESTORED" --skiplock 1 2>/dev/null || true
sleep 5 sleep 5
fi fi
fi
echo " Gestoppt." echo " Gestoppt."
# ═════════════════════════════════════════════════════════════════════════════ # ═════════════════════════════════════════════════════════════════════════════