mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-06-20 14:31:18 +02:00
refactor(ct): migrate manual update backups to create_backup (batch 1)
Replace ad-hoc mv/cp .bak patterns with create_backup/restore_backup across 58 update scripts so failed updates can roll back via the shared ERR trap. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+2
-13
@@ -38,22 +38,11 @@ function update_script() {
|
||||
systemctl stop actions-runner
|
||||
msg_ok "Stopped Service"
|
||||
|
||||
msg_info "Backing up runner configuration"
|
||||
BACKUP_DIR="/opt/actions-runner.backup"
|
||||
mkdir -p "$BACKUP_DIR"
|
||||
for f in .runner .credentials .credentials_rsaparams .env .path; do
|
||||
[[ -f /opt/actions-runner/$f ]] && cp -a /opt/actions-runner/$f "$BACKUP_DIR/"
|
||||
done
|
||||
msg_ok "Backed up configuration"
|
||||
create_backup /opt/actions-runner/$f
|
||||
|
||||
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "actions-runner" "actions/runner" "prebuild" "latest" "/opt/actions-runner" "actions-runner-linux-x64-*.tar.gz"
|
||||
restore_backup
|
||||
|
||||
msg_info "Restoring runner configuration"
|
||||
for f in .runner .credentials .credentials_rsaparams .env .path; do
|
||||
[[ -f "$BACKUP_DIR/$f" ]] && cp -a "$BACKUP_DIR/$f" /opt/actions-runner/
|
||||
done
|
||||
rm -rf "$BACKUP_DIR"
|
||||
msg_ok "Restored configuration"
|
||||
|
||||
msg_info "Starting Service"
|
||||
systemctl start actions-runner
|
||||
|
||||
Reference in New Issue
Block a user