51 lines
1.2 KiB
C++
51 lines
1.2 KiB
C++
#ifndef SYSTEMBACKUPPROXY_H
|
||
#define SYSTEMBACKUPPROXY_H
|
||
|
||
#include "workerfactory.h"
|
||
|
||
class SystemBackupProxy : public Worker
|
||
{
|
||
Q_OBJECT
|
||
DECLARE_DYNCREATE(SystemBackupProxy)
|
||
public:
|
||
// 系统备份的几种场景
|
||
enum SystemBackupScene {
|
||
SYSTEM_BACKUP, // 系统备份
|
||
INC_SYSTEM_BACKUP, // 增量系统备份
|
||
TRY_SYSTEM_BACKUP, // 测试系统备份,可用于计算备份传输数据大小
|
||
TRY_INC_SYSTEM_BACKUP, // 测试增量系统备份,可用于计算备份传输数据大小
|
||
};
|
||
|
||
explicit SystemBackupProxy();
|
||
virtual ~SystemBackupProxy();
|
||
|
||
public:
|
||
// 环境检测
|
||
virtual void checkEnvEx();
|
||
|
||
// 任务处理
|
||
virtual void doWorkEx();
|
||
|
||
// 任务取消
|
||
virtual void cancelEx();
|
||
|
||
private:
|
||
// 校验是否增量备份
|
||
bool checkIsIncBackup();
|
||
|
||
// 校验剩余空间是否满足备份
|
||
void checkFreeCapacity(bool bInc);
|
||
|
||
/**
|
||
* @brief 根据场景获取rsync命令参数
|
||
* @param scene,场景
|
||
* @return 组装好的rsync的参数信息
|
||
*/
|
||
QString getRsyncArgs(SystemBackupScene scene);
|
||
|
||
// 是否增量备份
|
||
bool m_bIncrement = false;
|
||
};
|
||
|
||
#endif // SYSTEMBACKUPPROXY_H
|