修改备份还原grub脚本,还原时跳过自定义备份

This commit is contained in:
zhaominyong 2022-04-27 11:11:58 +08:00
parent 469b65a5b0
commit 01661d1851
1 changed files with 7 additions and 0 deletions

View File

@ -581,6 +581,8 @@ generateExcludeFile() {
echo "/cdrom" >>$EXCLUDEFILE echo "/cdrom" >>$EXCLUDEFILE
echo "/swap_file" >>$EXCLUDEFILE echo "/swap_file" >>$EXCLUDEFILE
echo "/var/lib/docker/overlay2" >>$EXCLUDEFILE echo "/var/lib/docker/overlay2" >>$EXCLUDEFILE
echo "*/backup/snapshots" >>$EXCLUDEFILE
echo "/var/log" >>$EXCLUDEFILE
#bind挂载的目录不进行备份或还原 #bind挂载的目录不进行备份或还原
if [ -z $fstab_path ]; then if [ -z $fstab_path ]; then
@ -1004,6 +1006,10 @@ getLastUsefulBackupPointUuid() {
currentType=false currentType=false
fi fi
if [[ "$xxx" =~ "<Position>3</Position>" ]]; then
currentType=false
fi
if [[ "$xxx" =~ "</BackupPoint>" ]]; then if [[ "$xxx" =~ "</BackupPoint>" ]]; then
if [ "$currentState" = true -a "$currentType" = true ]; then #"/backup"是不是一个独立的盘 if [ "$currentState" = true -a "$currentType" = true ]; then #"/backup"是不是一个独立的盘
lastUsefulBackupPointUuid=$currentUuid lastUsefulBackupPointUuid=$currentUuid
@ -1116,6 +1122,7 @@ restoreAuto() { #还原
if [ ! -e "${restoreDir}/data/boot/efi" ]; then if [ ! -e "${restoreDir}/data/boot/efi" ]; then
excludes="${excludes} --exclude=/boot/efi" excludes="${excludes} --exclude=/boot/efi"
fi fi
excludes="${excludes} --exclude=*/backup/snapshots"
#yi jian huan yuan #yi jian huan yuan
if [ ! -e "${restoreDir}/data/data" ]; then if [ ! -e "${restoreDir}/data/data" ]; then
#这两行要一致 #这两行要一致