mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-09-24 05:07:15 +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
-9
@@ -35,19 +35,12 @@ function update_script() {
|
||||
systemctl stop ghostfolio
|
||||
msg_ok "Stopped Service"
|
||||
|
||||
msg_info "Creating Backup"
|
||||
tar -czf "/opt/ghostfolio_backup_$(date +%F).tar.gz" \
|
||||
-C /opt \
|
||||
--exclude="ghostfolio/node_modules" \
|
||||
--exclude="ghostfolio/dist" \
|
||||
ghostfolio
|
||||
mv /opt/ghostfolio/.env /opt/env.backup
|
||||
msg_ok "Backup Created"
|
||||
create_backup /opt/ghostfolio/.env
|
||||
|
||||
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "ghostfolio" "ghostfolio/ghostfolio" "tarball" "latest" "/opt/ghostfolio"
|
||||
restore_backup
|
||||
|
||||
msg_info "Updating Ghostfolio"
|
||||
mv /opt/env.backup /opt/ghostfolio/.env
|
||||
sed -i -E '/^DATABASE_URL=/ s/[?&]sslmode=prefer//g' /opt/ghostfolio/.env
|
||||
cd /opt/ghostfolio
|
||||
$STD npm ci
|
||||
|
||||
Reference in New Issue
Block a user