fix(wp-mirror): Cron-PATH und Tar-Fehlerbehandlung im Nacht-Sync

Cron.d lieferte kein /usr/sbin, pct wurde nicht gefunden (tägl. ABORT seit 29.06.).
This commit is contained in:
Homelab Cursor 2026-07-29 19:44:59 +02:00
parent d7fbe24228
commit f0013a9fd6

View file

@ -3,6 +3,7 @@
# CT101 impact: read-only mysqldump (--single-transaction) + read-only tar. No restarts.
# Logs: Host /var/log/wp-mirror-sync.log + CT600 /var/log/wp-mirror-sync.log → Loki (Promtail)
set -euo pipefail
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
HETZNER_HOST="${HETZNER_HOST:-root@100.88.230.59}"
HETZNER_CT="${HETZNER_CT:-101}"
@ -107,7 +108,10 @@ mv "${DB_FILE}.tmp" "$DB_FILE"
log "DB dump size: $(du -h "$DB_FILE" | awk '{print $1}')"
log "File sync via tar (read-only, ~58 min)..."
tar_sync_files
if ! tar_sync_files; then
log "ABORT: file sync via tar failed"
exit 1
fi
log "Files staged: $(du -sh "${STAGING}/wpfiles" | awk '{print $1}')"
for _ in $(seq 1 45); do