Sunday, June 28, 2015

Backup OpenVZ container CT to another hardware node for automatic scheduled remote backup

Proxmox does have a nice user interface which allows you to backup any OpenVZ container (even when it is live - using snapshot).  Did you know you can also do the same from command line?

You can use vzdump!

For example:

vzdump 104 --mode snapshot --compress lzo --stdout | ssh 10.0.1.1 "cat > /mnt/backup/vz/104/vzdump-openvz-104-2013_05_18-11_00_00.tar.lzo"


The above command will backup

CT 104

using 'snapshot' mode (live - without needing to shut it down)

with compression LZO mode

stores it to another server (in this example 10.0.1.1) using SSH

to a remote directory and filename:

    /mnt/backup/vz/104/vzdump-openvz-104-2013_05_18-11_00_00.tar.lzo


Why is this useful? well... for daily / routine backup of course!  Imagine never having to worry about backing up your VM ever again once you set this command nicely in your crontab. :-)

No comments:

Post a Comment