virtnbdbackup - Man Page

backup utility for libvirt

Description

usage: virtnbdbackup [-h] -d DOMAIN [-l {copy,full,inc,diff,auto}]

[-t {stream,raw}] [-r] -o OUTPUT [-C CHECKPOINTDIR]

[--scratchdir SCRATCHDIR] [-S] [--pause] [-i INCLUDE] [-x EXCLUDE] [-f SOCKETFILE] [-n] [-z [COMPRESS]] [-w WORKER] [-F FREEZE_MOUNTPOINT] [-e] [--no-sparse-detection] [-T THRESHOLD] [-U URI] [--user USER] [--ssh-user SSH_USER] [--ssh-port SSH_PORT] [--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

options

-h,  --help

show this help message and exit

General options

-d, --domain DOMAIN

Domain to backup

-l, --level {copy,full,inc,diff,auto}

Backup level. (default: copy)

-t, --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 target directory

-C, --checkpointdir CHECKPOINTDIR

Persistent libvirt checkpoint storage directory

--scratchdir SCRATCHDIR

Target dir for temporary scratch file. (default: /var/tmp)

-S, --start-domain

Start virtual machine if it is offline. (default: False)

--pause

Pause virtual machine while starting backup job. (default: False)

-i, --include INCLUDE

Backup only disk with target dev name (-i vda)

-x, --exclude EXCLUDE

Exclude disk(s) with target dev name (-x vda,vdb)

-f, --socketfile SOCKETFILE

Use specified file for NBD Server socket (default: /var/tmp/virtnbdbackup.147480)

-n, --noprogress

Disable progress bar

-z, --compress [COMPRESS]

Compress with lz4 compression level. (default: False)

-w, --worker WORKER

Amount of concurrent workers used to backup multiple disks. (default: amount of disks)

-F, --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)

--no-sparse-detection

Skip detection of sparse ranges during incremental or differential backup. (default: False)

-T, --threshold THRESHOLD

Execute backup only if threshold is reached.

Remote Backup options

-U,  --uri URI

Libvirt connection URI. (default: qemu:///session)

--user USER

User to authenticate against libvirtd. (default: None)

--ssh-user SSH_USER

User to authenticate against remote sshd: used for remote copy of files. (default: abi)

--ssh-port SSH_PORT

Port to connect to remote sshd: used for remote copy of files. (default: 22)

--password PASSWORD

Password to authenticate against libvirtd. (default: None)

-P,  --nbd-port NBD_PORT

Port used by remote NBD Service, should be unique for each started backup. (default: 10809)

-I,  --nbd-ip NBD_IP

IP used to bind remote NBD service on (default: hostname returned by libvirtd)

--tls

Enable and use TLS for NBD connection. (default: False)

--tls-cert TLS_CERT

Path to TLS certificates used during offline backup and restore. (default: /etc/pki/qemu/)

Logging options

-L,  --syslog

Additionally send log messages to syslog (default: False)

--quiet

Disable logging to stderr (default: False)

--nocolor

Disable colored output (default: False)

Debug options

-q,  --qemu

Use Qemu tools to query extents.

-s,  --startonly

Only initialize backup job via libvirt, do not backup any data

-k,  --killonly

Kill any running block job

-p,  --printonly

Quit after printing estimated checkpoint size.

-v,  --verbose

Enable debug output

-V,  --version

Show version and exit

Examples

# 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/

Info

January 2026 virtnbdbackup 2.45