From b98813d4294f0132280b0f945f33c1ea6a5a0994 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E6=B0=91=E5=8B=87?= Date: Wed, 17 Aug 2022 10:50:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=EF=BC=8C=E4=BB=A5=E9=98=B2?= =?UTF-8?q?=E9=97=AE=E9=A2=98=EF=BC=9A135259=20=E3=80=902203=E8=87=AA?= =?UTF-8?q?=E9=80=82=E5=BA=94=E5=8D=87=E7=BA=A72209=E3=80=91=E6=8E=A7?= =?UTF-8?q?=E5=88=B6=E9=9D=A2=E6=9D=BF=E5=A4=87=E4=BB=BD=E5=90=8E=E5=8D=87?= =?UTF-8?q?=E7=BA=A7=E5=88=B02209=EF=BC=8C=E7=B3=BB=E7=BB=9F=E8=BF=98?= =?UTF-8?q?=E5=8E=9F=E5=90=8E=EF=BC=8C=E5=85=B3=E4=BA=8E=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E5=AD=98=E5=9C=A8=E7=B3=BB=E7=BB=9F=E8=A1=A5=E4=B8=81=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backup-daemon/customizesystemrestoreproxy.cpp | 3 ++- backup-daemon/myprocess/rsyncpathtodirprocess.cpp | 6 ++++++ backup-daemon/systemrestoreproxy.cpp | 3 ++- backup-daemon/udisksystemrestoreproxy.cpp | 7 +++++-- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/backup-daemon/customizesystemrestoreproxy.cpp b/backup-daemon/customizesystemrestoreproxy.cpp index e595ebf..1dfe3d1 100755 --- a/backup-daemon/customizesystemrestoreproxy.cpp +++ b/backup-daemon/customizesystemrestoreproxy.cpp @@ -296,7 +296,8 @@ void CustomizeSystemRestoreProxy::restoreSystem() fileIfSync.replace("//", "/"); QFileInfo file(fileIfSync); QDateTime beginTime = file.fileTime(QFileDevice::FileModificationTime); - Utils::wait(10); + QProcess::execute("sync"); + Utils::wait(20); Utils::updateSyncFile(); while (1) { Utils::wait(2); diff --git a/backup-daemon/myprocess/rsyncpathtodirprocess.cpp b/backup-daemon/myprocess/rsyncpathtodirprocess.cpp index d924b4f..9866df4 100755 --- a/backup-daemon/myprocess/rsyncpathtodirprocess.cpp +++ b/backup-daemon/myprocess/rsyncpathtodirprocess.cpp @@ -90,17 +90,21 @@ void RsyncPathToDirProcess::rsync_finished(int exitCode, QProcess::ExitStatus) qDebug() << "RsyncPathToDirProcess::rsync_finished invoke begin"; if (exitCode == QProcess::NormalExit || exitCode == 24 || exitCode == 23) { if (m_block) { + qDebug() << "RsyncPathToDirProcess::rsync_finished block mode"; m_bSuccess = true; emit progress(100); emit finished(true); } else { + qDebug() << "RsyncPathToDirProcess::rsync_finished unblock mode"; m_syncProcess->start("sync"); if (!m_syncProcess->waitForStarted()) { + qDebug() << "sync start failed"; m_bSuccess = false; emit finished(false); } } } else { + qDebug() << "RsyncPathToDirProcess::rsync_finished failed"; m_bSuccess = false; emit finished(false); } @@ -112,10 +116,12 @@ void RsyncPathToDirProcess::sync_finished(int exitCode, QProcess::ExitStatus) qDebug() << "RsyncPathToDirProcess::sync_finished invoke begin"; if (exitCode == QProcess::NormalExit || exitCode == 24 || exitCode == 23) { + qDebug() << "RsyncPathToDirProcess::sync_finished success"; m_bSuccess = true; emit progress(100); emit finished(true); } else { + qDebug() << "RsyncPathToDirProcess::sync_finished failed"; m_bSuccess = false; emit finished(false); } diff --git a/backup-daemon/systemrestoreproxy.cpp b/backup-daemon/systemrestoreproxy.cpp index 82e0a20..a16809e 100755 --- a/backup-daemon/systemrestoreproxy.cpp +++ b/backup-daemon/systemrestoreproxy.cpp @@ -363,7 +363,8 @@ void SystemRestoreProxy::restoreSystem() // removeHome(Utils::getSysRootPath() + "/home"); // removeHome(Utils::getSysRootPath() + "/data/home"); // } - Utils::wait(10); + QProcess::execute("sync"); + Utils::wait(20); Utils::updateSyncFile(); while (1) { Utils::wait(2); diff --git a/backup-daemon/udisksystemrestoreproxy.cpp b/backup-daemon/udisksystemrestoreproxy.cpp index ef86e64..f8d2bb7 100755 --- a/backup-daemon/udisksystemrestoreproxy.cpp +++ b/backup-daemon/udisksystemrestoreproxy.cpp @@ -411,7 +411,9 @@ void UDiskSystemRestoreProxy::restoreSystem() fileIfSync.replace("//", "/"); QFileInfo file(fileIfSync); QDateTime beginTime = file.fileTime(QFileDevice::FileModificationTime); - Utils::wait(10); + // sync(); + QProcess::execute("sync"); + Utils::wait(20); Utils::updateSyncFile(); while (1) { Utils::wait(2); @@ -422,9 +424,10 @@ void UDiskSystemRestoreProxy::restoreSystem() } if (m_backupWrapper.m_isOtherMachine) { - Utils::wait(20); + Utils::wait(10); updateGrubUUid(); sync(); + QProcess::execute("sync"); Utils::wait(5); } }