← 返回命令列表

Linux command

vzdump 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Backup

vzdump [vm_id]

Example

vzdump [101] [102] [103]

Example

vzdump [vm_id] --mode [snapshot|stop|suspend]

Example

vzdump --all --mode snapshot --mailto [root@example.com]

Example

vzdump [vm_id] --dumpdir [/mnt/backup] --mode snapshot --compress zstd

Example

vzdump --all --exclude [101,102]

Example

vzdump [vm_id] --mode snapshot --prune-backups keep-last=5,keep-daily=7

说明

vzdump is a backup utility for Proxmox VE virtual machines (KVM) and containers (LXC). It creates consistent backups that can be restored later using qmrestore (VMs) or pct restore (containers). Three backup modes are available: snapshot (default, minimal downtime using LVM/ZFS/QEMU snapshots), stop (highest consistency, stops the guest during backup), and suspend (legacy compatibility mode). Backups are stored in /var/lib/vz/dump/ by default, or to a configured Proxmox storage.

参数

--mode _MODE_
Backup mode: snapshot (default, minimal downtime), stop (highest consistency, VM stops), or suspend (compatibility).
--dumpdir _DIR_
Store resulting backup files in DIR instead of the default location.
--storage _STORAGE_ID_
Store resulting backup files to the specified Proxmox storage.
--mailto _EMAIL_
Send notification email to address. Deprecated in favor of notification system.
--all
Backup all known guest systems on the host.
--exclude _VMIDS_
Exclude specified VM IDs (assumes --all).
--pool _POOL_
Backup all guest systems in the specified pool.
--compress _TYPE_
Compression type: 0 (none, default), gzip, lzo, or zstd.
--zstd _N_
Zstandard thread count (default: 1). 0 uses half of available cores.
--pigz _N_
Use parallel gzip. N=1 uses half of available cores; N>1 uses N threads.
--prune-backups _RETENTION_
Retention policy (e.g., keep-last=N,keep-daily=N,keep-weekly=N,keep-monthly=N,keep-yearly=N). Default: keep-all=1.
--maxfiles _N_
Deprecated. Maximum number of backup files per VM. Use --prune-backups instead.
--protected
Mark backup as protected to prevent automatic removal.
--bwlimit _KiB/s_
Limit I/O bandwidth in KiB/s (default: 0, unlimited).
--ionice _N_
Set IO priority (0-8) when using the BFQ scheduler (default: 7).
--tmpdir _DIR_
Store temporary files in DIR.
--lockwait _MIN_
Maximum minutes to wait for the global lock (default: 180).
--stopwait _MIN_
Maximum minutes to wait until the guest system stops (default: 10).
--script _FILE_
Execute hook script during backup.
--notes-template _TEMPLATE_
Template for backup notes. Variables: {{vmid}}, {{guestname}}, {{node}}, {{cluster}}.
--quiet
Suppress verbose output.
--stdexcludes
Exclude temporary files and logs (default: enabled).

FAQ

What is the vzdump command used for?

vzdump is a backup utility for Proxmox VE virtual machines (KVM) and containers (LXC). It creates consistent backups that can be restored later using qmrestore (VMs) or pct restore (containers). Three backup modes are available: snapshot (default, minimal downtime using LVM/ZFS/QEMU snapshots), stop (highest consistency, stops the guest during backup), and suspend (legacy compatibility mode). Backups are stored in /var/lib/vz/dump/ by default, or to a configured Proxmox storage.

How do I run a basic vzdump example?

Run `vzdump [vm_id]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --mode _MODE_ do in vzdump?

Backup mode: snapshot (default, minimal downtime), stop (highest consistency, VM stops), or suspend (compatibility).