From d1095853c18ae72f917b5193efda8bc790a9ce15 Mon Sep 17 00:00:00 2001 From: host Date: Mon, 26 Oct 2026 06:59:38 +0800 Subject: [PATCH] deploy: exclude worker heartbeat from host backup tar The worker rewrites ./worker-heartbeat.json every poll interval (10s); the host backup tar reads the same directory, so it could hit 'file changed as we read it', exit 1, and abort the deploy under set -e (this killed the PR #22 deploy). The heartbeat file is regenerable runtime state, not code, so excluding it from the backup is correct, not a workaround. --- deploy/deploy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/deploy.sh b/deploy/deploy.sh index c8864bd..063444e 100755 --- a/deploy/deploy.sh +++ b/deploy/deploy.sh @@ -125,7 +125,7 @@ wait_health() { } # 1. 备份当前代码(排除 work/,只留最近 3 份) -tar --exclude='./work' -czf "$BACKUP_FILE" -C /opt codex-app-server +tar --exclude='./work' --exclude='./worker-heartbeat.json' -czf "$BACKUP_FILE" -C /opt codex-app-server echo "已备份当前代码到:$BACKUP_FILE" ls -t "$BACKUP_DIR"/codex-app-server-*.tar.gz 2>/dev/null \ | tail -n +4 | xargs -r rm -f