From 5f29fbaa1f0fdf4892a6c20ae94c4295f9c8bcfd Mon Sep 17 00:00:00 2001 From: mango Date: Mon, 2 Feb 2026 08:42:23 +0800 Subject: [PATCH] =?UTF-8?q?v2.5:=20=E6=81=A2=E5=A4=8D=E6=97=B6=E6=8E=92?= =?UTF-8?q?=E9=99=A4SSH/=E7=BD=91=E7=BB=9C=E9=85=8D=E7=BD=AE=EF=BC=8C?= =?UTF-8?q?=E9=81=BF=E5=85=8D=E8=BF=9E=E6=8E=A5=E6=96=AD=E5=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vps-snapshot.sh | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/vps-snapshot.sh b/vps-snapshot.sh index f831f08..27d7d0b 100755 --- a/vps-snapshot.sh +++ b/vps-snapshot.sh @@ -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"