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:
parent
d7fbe24228
commit
f0013a9fd6
1 changed files with 5 additions and 1 deletions
|
|
@ -3,6 +3,7 @@
|
||||||
# CT101 impact: read-only mysqldump (--single-transaction) + read-only tar. No restarts.
|
# 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)
|
# Logs: Host /var/log/wp-mirror-sync.log + CT600 /var/log/wp-mirror-sync.log → Loki (Promtail)
|
||||||
set -euo pipefail
|
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_HOST="${HETZNER_HOST:-root@100.88.230.59}"
|
||||||
HETZNER_CT="${HETZNER_CT:-101}"
|
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 "DB dump size: $(du -h "$DB_FILE" | awk '{print $1}')"
|
||||||
|
|
||||||
log "File sync via tar (read-only, ~5–8 min)..."
|
log "File sync via tar (read-only, ~5–8 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}')"
|
log "Files staged: $(du -sh "${STAGING}/wpfiles" | awk '{print $1}')"
|
||||||
|
|
||||||
for _ in $(seq 1 45); do
|
for _ in $(seq 1 45); do
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue