abbbi / abbbi/virtnbdbackup

Only use full backups as base for differential backups

Đang mở
#273 7 bình luận 0 reaction 0 người được giao Xem trên GitHub
enhancement
Ngôn ngữ chính
Python
Star
518
Fork
57
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

### 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₂`.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.