v2.5: 恢复时排除SSH/网络配置,避免连接断开
This commit is contained in:
@@ -394,12 +394,29 @@ do_restore() {
|
|||||||
--exclude='/mnt/*' \
|
--exclude='/mnt/*' \
|
||||||
--exclude='/media/*' \
|
--exclude='/media/*' \
|
||||||
--exclude='/lost+found' \
|
--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="$LOCAL_DIR/*" \
|
||||||
--exclude="$temp_dir" \
|
--exclude="$temp_dir" \
|
||||||
"$temp_dir/" /
|
"$temp_dir/" /
|
||||||
else
|
else
|
||||||
log "覆盖恢复"
|
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
|
fi
|
||||||
|
|
||||||
rm -rf "$temp_dir"
|
rm -rf "$temp_dir"
|
||||||
|
|||||||
Reference in New Issue
Block a user