abbbi / abbbi/virtnbdbackup

Only use full backups as base for differential backups

未关闭
#273 7 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
enhancement
主要语言
Python
星标
518
派生
57
PR 合并指标
30 天内没有已合并 PR

描述

### Each diff backup should save all changes that have occurred since the last full backup.
`Full → Inc₁ → Inc₂ → Diff (all changes after Full) → Inc₃ → Diff (again all changes after Full)`

libvirtnbdbackup/virt/checkpoints.py
```
if args.level == "diff":
parentCheckpoint = checkpoints[0] #for take ONLY full backup
# ...
```

virtnbdrestore
```
dataFiles: List[str] = []
if args.sequence is not None:
logging.info("Using manual specified sequence of files.")
logging.info("Disabling redefine and config adjust options.")
args.define = False
args.adjust_config = False
dataFiles = args.sequence.split(",")

if "full" not in dataFiles[0] and "copy" not in dataFiles[0]:
logging.error("Sequence must start with full or copy backup.")
sys.exit(1)
else:
dataFiles = lib.getLatest(args.input, "*.data")
dataFiles = [f for f in dataFiles if '.diff.' not in os.path.basename(f)] #SKIP take diff for restoring by util
if not dataFiles:
logging.error("No data files (excluding diff backups) found in directory: [%s]", args.input)
sys.exit(1)
```

**Example workflow**
* Monday: `Full` (original copy).
* Tuesday: `Inc₁` (changes after `Full`).
* Wednesday:` Inc₂` (changes after `Inc₁`).
* Thursday: `Diff₁` (all changes from `Full`, including `Inc₁` + `Inc₂`).
* Friday: `Inc₃` (changes after `Diff₁`).
* Saturday: `Diff₂` (all changes from Full, including `Inc₁` + `Inc₂` + `Inc₃`).

**Restore to Saturday:**
* `Full` (Monday) + `Diff₂` (Saturday).

* `Inc₁`, `Inc₂`, `Inc₃` are not required - their changes are already in `Diff₂`.

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。