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.
This commit is contained in:
1 parent
c5d245a7fb
commit
d1095853c1
1 file changed
+1
-1
+1
-1
@@ -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
|
||||
|
||||
Reference in new issue
Block a user