yhkylin-backup-tools/backup-daemon/udiskdatabackupproxy.h

64 lines
1.4 KiB
C
Raw Normal View History

2021-12-26 18:15:21 +08:00
#ifndef UDISKDATABACKUPPROXY_H
#define UDISKDATABACKUPPROXY_H
#include "databackupproxy.h"
class UDiskDataBackupProxy : public DataBackupProxy
{
Q_OBJECT
DECLARE_DYNCREATE(UDiskDataBackupProxy)
public:
explicit UDiskDataBackupProxy();
virtual ~UDiskDataBackupProxy();
public:
// 环境检测
virtual bool checkEnvEx();
// 任务处理
virtual void doWorkEx();
2022-01-18 17:35:26 +08:00
public slots:
2021-12-26 18:15:21 +08:00
// 任务取消
virtual void cancelEx();
private slots:
// 校验剩余空间是否满足备份
bool checkFreeCapacityToUdisk(qint64 itotalSize);
// 备份
void doBackupToUdisk();
/**
* @brief
* @return: bool,truefalse
* @author: zhaominyong
* @since: 2021/05/24
* @note:
* add by zhaominyong at 2021/05/24 for bug:54377 U盘的过程中拔出U盘
*/
bool checkDestDirExists();
2022-01-18 17:35:26 +08:00
protected:
// 失败则删除相应数据
virtual void deleteFailedData();
2021-12-26 18:15:21 +08:00
private:
// 计算备份所需空间大小
void calcSizeForBackupToUdisk();
/**
* @brief /backup/snapshots/backuplist.xml文件
* @return true-false-
*/
bool recordBackupPointToUdisk();
// 备份准备
bool doPrepareToUdisk();
// 备份系统
bool backupDataToUdisk();
};
#endif // UDISKDATABACKUPPROXY_H