自测发现U盘数据增量备份有问题

This commit is contained in:
zhaominyong 2022-06-30 16:37:15 +08:00
parent 80e2f70953
commit a45e7a27c0
3 changed files with 27 additions and 1 deletions

View File

@ -58,7 +58,7 @@ private:
protected:
// 判断是否增量备份
bool isIncBackup();
virtual bool isIncBackup();
/**
* @brief rsync命令参数

View File

@ -122,6 +122,30 @@ void UDiskDataBackupProxy::deleteFailedData()
parse.deleteItem(m_curUuid);
}
/**
* @brief
* @return true, false
*/
bool UDiskDataBackupProxy::isIncBackup()
{
QString backupPath;
ParseBackupList::BackupPoint point;
if (m_backupWrapper.m_uuid.isEmpty()) {
return false;
} else {
backupPath = m_backupWrapper.m_prefixDestPath + BACKUP_SNAPSHOTS_PATH + "/" + m_backupWrapper.m_uuid + "/data";
}
backupPath.replace("//", "/");
if (Utils::isDirExist(backupPath)) {
m_backupWrapper.m_bIncrement = true;
m_backupWrapper.m_type = BackupType::INC_BACKUP_DATA;
return true;
}
return false;
}
/**
* @brief
*/

View File

@ -42,6 +42,8 @@ private slots:
protected:
// 失败则删除相应数据
virtual void deleteFailedData();
// 判断是否增量备份
virtual bool isIncBackup();
private:
// 计算备份所需空间大小