v2.5: 恢复时排除SSH/网络配置,避免连接断开

This commit is contained in:
mango
2026-02-02 08:42:23 +08:00
parent 6d5f1de260
commit 5f29fbaa1f

View File

@@ -394,12 +394,29 @@ do_restore() {
--exclude='/mnt/*' \
--exclude='/media/*' \
--exclude='/lost+found' \
--exclude='/etc/ssh/*' \
--exclude='/root/.ssh/*' \
--exclude='/etc/shadow' \
--exclude='/etc/passwd' \
--exclude='/etc/hostname' \
--exclude='/etc/hosts' \
--exclude='/etc/network/*' \
--exclude='/etc/netplan/*' \
--exclude="$LOCAL_DIR/*" \
--exclude="$temp_dir" \
"$temp_dir/" /
else
log "覆盖恢复"
rsync -aAXv "$temp_dir/" /
rsync -aAXv \
--exclude='/etc/ssh/*' \
--exclude='/root/.ssh/*' \
--exclude='/etc/shadow' \
--exclude='/etc/passwd' \
--exclude='/etc/hostname' \
--exclude='/etc/hosts' \
--exclude='/etc/network/*' \
--exclude='/etc/netplan/*' \
"$temp_dir/" /
fi
rm -rf "$temp_dir"