virtnbdbackup - backup utility for libvirt
usage: virtnbdbackup [-h] -d DOMAIN [-l
{copy,full,inc,diff,auto}]
- [-t {stream,raw}] [-r] -o OUTPUT [-C CHECKPOINTDIR]
- [-S SCRATCHDIR] [-i INCLUDE] [-x EXCLUDE] [-f SOCKETFILE] [-n] [-z
[COMPRESS]] [-w WORKER] [-F FREEZE_MOUNTPOINT] [-e] [-T THRESHOLD] [-U
URI] [--user USER] [--ssh-user SSH_USER] [--password PASSWORD] [-P
NBD_PORT] [-I NBD_IP] [--tls] [--tls-cert TLS_CERT] [-L] [--quiet]
[--nocolor] [-q] [-s] [-k] [-p] [-v] [-V]
Backup libvirt/qemu virtual machines
- -d DOMAIN, --domain
DOMAIN
- Domain to backup
- -l {copy,full,inc,diff,auto},
--level {copy,full,inc,diff,auto}
- Backup level. (default: copy)
- -t {stream,raw},
--type {stream,raw}
- Output type: stream or raw. (default: stream)
- -r, --raw
- Include full provisioned disk images in backup. (default: False)
- -o OUTPUT, --output
OUTPUT
- Output target directory
- -C CHECKPOINTDIR,
--checkpointdir CHECKPOINTDIR
- Persistent libvirt checkpoint storage directory
- -S SCRATCHDIR,
--scratchdir SCRATCHDIR
- Target dir for temporary scratch file. (default: /var/tmp)
- -i INCLUDE, --include
INCLUDE
- Backup only disk with target dev name (-i vda)
- -x EXCLUDE, --exclude
EXCLUDE
- Exclude disk(s) with target dev name (-x vda,vdb)
- -f SOCKETFILE,
--socketfile SOCKETFILE
- Use specified file for NBD Server socket (default:
/var/tmp/virtnbdbackup.5688)
- -n,
--noprogress
- Disable progress bar
- -z [COMPRESS],
--compress [COMPRESS]
- Compress with lz4 compression level. (default: False)
- -w WORKER, --worker
WORKER
- Amount of concurrent workers used to backup multiple disks. (default:
amount of disks)
- -F FREEZE_MOUNTPOINT,
--freeze-mountpoint FREEZE_MOUNTPOINT
- If qemu agent available, freeze only filesystems on specified mountpoints
within virtual machine (default: all)
- -e, --strict
- Change exit code if warnings occur during backup operation. (default:
False)
- -T THRESHOLD,
--threshold THRESHOLD
- Execute backup only if threshold is reached.
- -L, --syslog
- Additionally send log messages to syslog (default: False)
- --quiet
- Disable logging to stderr (default: False)
- --nocolor
- Disable colored output (default: False)
- # full backup of domain 'webvm' with all attached disks:
- virtnbdbackup -d webvm -l full -o /backup/
- # incremental backup:
- virtnbdbackup -d webvm -l inc -o /backup/
- # differential backup:
- virtnbdbackup -d webvm -l diff -o /backup/
- # full backup, exclude disk 'vda':
- virtnbdbackup -d webvm -l full -x vda -o /backup/
- # full backup, backup only disk 'vdb':
- virtnbdbackup -d webvm -l full -i vdb -o /backup/
- # full backup, compression enabled:
- virtnbdbackup -d webvm -l full -z -o /backup/
- # full backup, create archive:
- virtnbdbackup -d webvm -l full -o - > backup.zip
- # full backup of vm operating on remote libvirtd:
- virtnbdbackup -U qemu+ssh://root@remotehost/system --ssh-user root -d
webvm -l full -o /backup/