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); } }