Skip to content

Commit

Permalink
#53 change default backup mode to auto
Browse files Browse the repository at this point in the history
  • Loading branch information
abbbi committed Jun 24, 2024
1 parent 65db7f3 commit 6a26d6f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 14 deletions.
1 change: 1 addition & 0 deletions Changelog
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Version 2.11
---------
* Update README
* Change default backup mode to `auto`.
* Raise NBD connection error if `--tls` option is set but installed libnbd
bindings for python do not support required features.
* Set TLS connection options to TLS_REQUIRE instead of TLS_ALLOW which would
Expand Down
29 changes: 16 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,18 +233,21 @@ See [packages](https://github.com/abbbi/virtnbdbackup/pkgs/container/virtnbdback
Following backup modes can be used:

* `auto`: If the target folder is empty, attempt to execute full backup,
otherwise switch to backup mode incremental: allows rotation of backup
into monthly folders.
otherwise switch to backup mode incremental: allows [rotating
backups](#rotating-backups) into monthly folders.
`This is the default backup mode.`

* `full`: Full, thin provisioned backup of the virtual machine, a new checkpoint
named `virtnbdbackup` will be created, all existent checkpoints from prior
backups matching this name will be removed: a new backup chain is created.
The Virtual machine must be online and running for this backup mode to work.
The Virtual machine must be online and running for this backup mode to work,
see [Backing up offline virtual domains](#backing-up-offline-virtual-domains)
for more information.

* `copy`: Full, thin provisioned backup of the virtual machine disks, no
checkpoint is created for further incremental backups, existing checkpoints
will be left untouched. This is the default mode and works with qcow images
not supporting persistent bitmaps.
will be left untouched. This backup mode works with qcow images not
supporting persistent bitmaps.

* `inc`: Perform incremental backup, based on the last full or incremental
backup. A checkpoint for each incremental backup is created and saved.
Expand Down Expand Up @@ -354,7 +357,7 @@ backup.
## Application consistent backups

During backup `virtnbdbackup` attempts to freeze all file systems within the
domain using the qemu guest agent filesystem freeze and thaw functions. In
domain using the qemu guest agent filesystem freeze and thaw functions. In
case no qemu agent is installed or filesystem freeze fails, a warning is shown
during backup:

Expand All @@ -380,17 +383,17 @@ and thawed.

## Rotating backups

With backup mode `auto` it is possible to have a monthly rotation/retention. If
the target folder is empty, backup mode auto will create an full backup. On the
With the default backup mode `auto` it is possible to rotate backups. If the
target folder is empty, backup mode auto will create an full backup. On the
following executions, it will automatically switch to backup mode incremental,
if the target folder already includes an full backup. Example:

```
virtnbdbackup -d vm1 -l auto -o /tmp/2022-06 -> creates full backup
virtnbdbackup -d vm1 -l auto -o /tmp/2022-06 -> creates inc backup
virtnbdbackup -d vm1 -l auto -o /tmp/2022-06 -> creates inc backup
virtnbdbackup -d vm1 -l auto -o /tmp/2022-07 -> creates full backup
virtnbdbackup -d vm1 -l auto -o /tmp/2022-07 -> creates inc backup
virtnbdbackup -d vm1 -o /tmp/2022-06 -> creates full backup
virtnbdbackup -d vm1 -o /tmp/2022-06 -> creates inc backup
virtnbdbackup -d vm1 -o /tmp/2022-06 -> creates inc backup
virtnbdbackup -d vm1 -o /tmp/2022-07 -> creates full backup
virtnbdbackup -d vm1 -o /tmp/2022-07 -> creates inc backup
```

## Excluding disks
Expand Down
2 changes: 1 addition & 1 deletion virtnbdbackup
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def main() -> None:
opt.add_argument(
"-l",
"--level",
default="copy",
default="auto",
choices=["copy", "full", "inc", "diff", "auto"],
type=str,
help="Backup level. (default: %(default)s)",
Expand Down

0 comments on commit 6a26d6f

Please sign in to comment.