Open main menu

OpenVZ Virtuozzo Containers Wiki β

Changes

Ploop/Backup

922 bytes added, 02:19, 12 June 2013
created
This article explains how to do consistent file-based backups for [[ploop]] containers, using ploop snapshot feature.

Assuming you have a running container identified by <code>$CTID</code>. The following needs to be done:

<source lang="bash">
# Known snapshot ID
ID=$(uuidgen)

# Directory used to mount a snapshot
MNTDIR=./mnt
mkdir $MNTDIR

# Take a snapshot without suspending a CT and saving its config
vzctl snapshot $CTID --id $ID --skip-suspend --skip-config

# Mount the snapshot taken
vzctl snapshot-mount $CTID --id $ID --target $MNTDIR

# Perform a backup using your favorite backup tool
# (tar is just an example)
tar cf backup.tar.xz $MNTDIR

# Unmount the snapshot
vzctl snapshot-umount $CTID --id $ID

# Delete (merge) the snapshot
vzctl snapshot-delete $CTID --id $ID
</source>

For more information, see [[Man/vzctl.8#Snapshotting|vzctl(8), section Snapshotting]].

[[Category:ploop]]
[[Category:HOWTO]]