From 165e8c9636eb89059b9c1593cf7c71bdae9434c4 Mon Sep 17 00:00:00 2001 From: MacRimi Date: Tue, 9 Jun 2026 19:44:14 +0200 Subject: [PATCH] Update backup_host.sh --- scripts/backup_restore/backup_host.sh | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/scripts/backup_restore/backup_host.sh b/scripts/backup_restore/backup_host.sh index e9268b0c..66eda08c 100644 --- a/scripts/backup_restore/backup_host.sh +++ b/scripts/backup_restore/backup_host.sh @@ -1089,7 +1089,31 @@ _rs_apply() { # Apply if [[ -d "$src" ]]; then mkdir -p "$dst" - rsync -aAXH --delete "$src/" "$dst/" 2>/dev/null && ((applied++)) || ((skipped++)) + # /usr/local/share/proxmenux/: symmetric to the backup-time excludes + # in lib_host_backup_common.sh. We keep the destination's freshly- + # installed code (scripts/, web/, AppImage/, monitor-app/, utils.sh) + # and only restore the user's state (components_status.json, dbs, + # configs). Without these excludes --delete would wipe the entire + # /scripts/ tree on the target and the pending-restore boot service + # would fail to find its own entry point. + local -a rsync_extra=() + if [[ "$rel" == "usr/local/share/proxmenux" ]]; then + rsync_extra+=( + --exclude "scripts/" + --exclude "web/" + --exclude "monitor-app/" + --exclude "monitor-app.*/" + --exclude "AppImage/" + --exclude "images/" + --exclude "json/" + --exclude "utils.sh" + --exclude "helpers_cache.json" + --exclude "ProxMenux-Monitor.AppImage*" + --exclude "install_proxmenux*.sh" + --exclude "restore-pending/" + ) + fi + rsync -aAXH --delete "${rsync_extra[@]}" "$src/" "$dst/" 2>/dev/null && ((applied++)) || ((skipped++)) else mkdir -p "$(dirname "$dst")" cp -a "$src" "$dst" 2>/dev/null && ((applied++)) || ((skipped++))