Backup to many servers by ProxmoxVE

VGusev2007

Renowned Member
May 24, 2010
95
11
73
Russia
Hi all!


I have two servers.

The first server is: Proxmox-VE. I have more VMs.

The second server is: Backup server. It powered by FreeNAS. It has a large hdd.

The second server is remotly. It lives in a remote server room.

I need to create backup dublicated.

For example:

Step 1:
I want to create a fast backup by backup my VMs to LOCAL hdd mounted to /mnt/backup

Step 2:
I want to copy a backup file from LOCAL hdd /mnt/backup to second server, AFTER step 1 (i.e. by scp or rscp or nfs). And delete old backup on second server.

What do I need for this?

RTFM says me about the file: /etc/cron.d/vzdump

Code:
# Atomatically generated file - do not edit

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

00 02 * * 1,2,3,4,5   root vzdump --quiet --snapshot --storage BACKUP 106
40 02 * * 7           root vzdump --quiet --snapshot --storage BACKUP 101
00 03 * * 1,3,5       root vzdump --quiet --snapshot --storage BACKUP 103
....
and so on

I can edit this file by hand like this:

Code:
# 106
00 02 * * 1,2,3,4,5   root /patch/to/my/custom/script

And create script file like this:

Code:
!#/bin/bash
vzdump --quiet --snapshot --storage BACKUP 106
if ....
then ... backup to remote server ....
....
....
exit 0

I think it is an bad idea and a bad design.

What are you think about my problem?
 
You can use a hook script for that. See

/usr/share/doc/vzdump/examples/hook-script.pl

Thank a lot for you.

I read man pages of vzdump:

HOOK SCRIPT
You can specify a hook script with option "--script". This script is called at various phases
of the backup process, with parameters accordingly set. You can find an example in the
documentation directory ("hook-script.pl").


For use this featches i need to edit:

Code:
/etc/cron.d/vzdump
like this:

Code:
00 02 * * 1,2,3,4,5   root vzdump --quiet --snapshot --storage BACKUP 106 --script /patch/to/script.pl


Will it a good solution?
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!