From 9d727038e16cd65955979746962135af27ff3922 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E6=B0=91=E5=8B=87?= Date: Sun, 9 Oct 2022 11:21:56 +0800 Subject: [PATCH] =?UTF-8?q?142904=20=E3=80=90=E6=B1=9F=E8=A5=BF=E9=93=B6?= =?UTF-8?q?=E8=A1=8C=E3=80=91=E3=80=90grub=E8=BF=98=E5=8E=9F=E3=80=91?= =?UTF-8?q?=E5=9C=A8grub=E7=95=8C=E9=9D=A2=E9=80=89=E6=8B=A9restore-retain?= =?UTF-8?q?-userdata=20mod=E6=A8=A1=E5=BC=8F=E8=BF=98=E5=8E=9F=EF=BC=8C?= =?UTF-8?q?=E8=BF=98=E5=8E=9F=E4=B9=8B=E5=90=8E=E5=9F=9F=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backup-daemon/customizesystemrestoreproxy.cpp | 17 +++++++++++++++++ backup-daemon/data/backup-auto-efi | 5 +++++ backup-daemon/systemrestoreproxy.cpp | 17 +++++++++++++++++ backup-daemon/udisksystemrestoreproxy.cpp | 17 +++++++++++++++++ 4 files changed, 56 insertions(+) diff --git a/backup-daemon/customizesystemrestoreproxy.cpp b/backup-daemon/customizesystemrestoreproxy.cpp index 1dfe3d1..74c6bf7 100755 --- a/backup-daemon/customizesystemrestoreproxy.cpp +++ b/backup-daemon/customizesystemrestoreproxy.cpp @@ -228,6 +228,23 @@ QStringList CustomizeSystemRestoreProxy::getRsyncArgs(CustomizeSystemRestoreScen // 云桌面背景路径属于用户数据 args << "--exclude=/var/lib/AccountsService"; + + // 域用户相关信息,还原后保持不退域 + args << "--exclude=/etc/sssd"; + args << "--exclude=/var/lib/sss"; + args << "--exclude=/usr/share/sssd"; + args << "--exclude=/etc/ipa"; + args << "--exclude=/etc/krb5.keytab"; + args << "--exclude=/etc/krb5.conf"; + args << "--exclude=/var/lib/ipa-client"; + args << "--exclude=/etc/nsswitch.conf"; + args << "--exclude=/etc/pam.d"; + args << "--exclude=/etc/hosts"; + args << "--exclude=/etc/hostname"; + args << "--exclude=/etc/hedron"; + args << "--exclude=/etc/kcm"; + args << "--exclude=/usr/hedron/hedronagent"; + // 此处不要break,因为还需要排除SYSTEM_RESTORE中的项 case CustomizeSystemRestoreScene::SYSTEM_RESTORE : diff --git a/backup-daemon/data/backup-auto-efi b/backup-daemon/data/backup-auto-efi index 55dbcdb..13fc52c 100755 --- a/backup-daemon/data/backup-auto-efi +++ b/backup-daemon/data/backup-auto-efi @@ -1098,6 +1098,10 @@ restoreAuto() { #还原 excludes="${excludes} --exclude=/etc/sudoers" fi excludes="${excludes} --exclude=/home --exclude=/root --exclude=/data/home --exclude=/data/root --exclude=/var/lib/AccountsService" + #下面是域用户相关信息,保留用户数据还原后不退域 + excludes="${excludes} --exclude=/etc/sssd --exclude=/var/lib/sss --exclude=/usr/share/sssd --exclude=/etc/ipa --exclude=/etc/krb5.keytab" + excludes="${excludes} --exclude=/etc/krb5.conf --exclude=/var/lib/ipa-client --exclude=/etc/nsswitch.conf --exclude=/etc/pam.d --exclude=/etc/hosts" + excludes="${excludes} --exclude=/etc/hedron --exclude=/etc/hedron --exclude=/etc/kcm --exclude=/usr/hedron/hedronagent" #如果是990,排除/data;否则,排除/data/usershare if [ x${is_990_9a0} == x"true" ]; then @@ -1128,6 +1132,7 @@ restoreAuto() { #还原 if [ ! -e "${restoreDir}/data/boot/efi" ]; then excludes="${excludes} --exclude=/boot/efi" fi + excludes="${excludes} --exclude=/var/log" excludes="${excludes} --exclude=*/backup/snapshots" #yi jian huan yuan if [ ! -e "${restoreDir}/data/data" ]; then diff --git a/backup-daemon/systemrestoreproxy.cpp b/backup-daemon/systemrestoreproxy.cpp index 6f8ca32..3dab459 100755 --- a/backup-daemon/systemrestoreproxy.cpp +++ b/backup-daemon/systemrestoreproxy.cpp @@ -243,6 +243,23 @@ QStringList SystemRestoreProxy::getRsyncArgs(SystemRestoreScene scene) // 云图片作为桌面背景的路径属于用户数据 args << "--exclude=/var/lib/AccountsService"; + + // 域用户相关信息,还原后保持不退域 + args << "--exclude=/etc/sssd"; + args << "--exclude=/var/lib/sss"; + args << "--exclude=/usr/share/sssd"; + args << "--exclude=/etc/ipa"; + args << "--exclude=/etc/krb5.keytab"; + args << "--exclude=/etc/krb5.conf"; + args << "--exclude=/var/lib/ipa-client"; + args << "--exclude=/etc/nsswitch.conf"; + args << "--exclude=/etc/pam.d"; + args << "--exclude=/etc/hosts"; + args << "--exclude=/etc/hostname"; + args << "--exclude=/etc/hedron"; + args << "--exclude=/etc/kcm"; + args << "--exclude=/usr/hedron/hedronagent"; + // 此处不要break,因为还需要排除SYSTEM_RESTORE中的项 case SystemRestoreScene::SYSTEM_RESTORE : diff --git a/backup-daemon/udisksystemrestoreproxy.cpp b/backup-daemon/udisksystemrestoreproxy.cpp index f8d2bb7..cf32b78 100755 --- a/backup-daemon/udisksystemrestoreproxy.cpp +++ b/backup-daemon/udisksystemrestoreproxy.cpp @@ -246,6 +246,23 @@ QStringList UDiskSystemRestoreProxy::getRsyncArgs(SystemRestoreScene scene) // 云桌面背景路径属于用户数据 args << "--exclude=/var/lib/AccountsService"; + + // 域用户相关信息,还原后保持不退域 + args << "--exclude=/etc/sssd"; + args << "--exclude=/var/lib/sss"; + args << "--exclude=/usr/share/sssd"; + args << "--exclude=/etc/ipa"; + args << "--exclude=/etc/krb5.keytab"; + args << "--exclude=/etc/krb5.conf"; + args << "--exclude=/var/lib/ipa-client"; + args << "--exclude=/etc/nsswitch.conf"; + args << "--exclude=/etc/pam.d"; + args << "--exclude=/etc/hosts"; + args << "--exclude=/etc/hostname"; + args << "--exclude=/etc/hedron"; + args << "--exclude=/etc/kcm"; + args << "--exclude=/usr/hedron/hedronagent"; + // 此处不要break,因为还需要排除SYSTEM_RESTORE中的项 case SystemRestoreScene::SYSTEM_RESTORE :