OpenVZ Forum

Home » General » Support » Snapshotscript Ploop/Backup
Snapshotscript Ploop/Backup [message #51406] Fri, 09 May 2014 15:14
luzifer2222 is currently offline  luzifer2222
Messages: 2
Registered: May 2014
Location: Germany
Junior Member
From: *
Hey Guys,

I need help with the Snapshot-script.
I take this script to do my snapshots:

array_der_virtuellen_maschienen=$(/usr/sbin/vzlist -a1H)
for virtuelle_maschiene in $array_der_virtuellen_maschienen;

BACKUPPATH=/raid/.backup_vz/$virtuelle_maschiene/$virtuelle_maschiene-$( date +%F_%H_%M )

/bin/mkdir -p $BACKUPPATH

# Known snapshot ID
VE_PRIVATE=$(/usr/sbin/vzlist -H -o private $virtuelle_maschiene)

# Take a snapshot without suspending a CT and saving its config
/usr/sbin/vzctl snapshot $virtuelle_maschiene --id $ID

# Perform a backup using your favorite backup tool
# (cp is just an example)
/usr/bin/rsync -av $VE_PRIVATE/root.hdd/* $BACKUPPATH/

# Delete (merge) the snapshot
/usr/sbin/vzctl snapshot-delete $virtuelle_maschiene --id $ID

# remove old backups
/bin/rm -rf $( find /raid/.backup_vz/$virtuelle_maschiene/* -type d -name "$virtuelle_maschiene*" -exec ls -d1rt "{}" + | head -n-4  )


chmod 600 /raid/.backup_vz


But I do not understand why I first create a snapshot then copy it to my backup path an after that I delete the snapshot.

Every time I backup my CT 's I have to copy the complete root.hdd directory, but my CT Ploop devices are huge and it takes a lot of time to copy it.
Is there a opportunity to copy just the created snapshot files?

I hope anyone could help me. Thank you.
Previous Topic: [SOLVED]Updating templates on ploop system
Next Topic: ploop backup question - exclude delta file
Goto Forum:

Current Time: Thu Apr 25 02:04:50 GMT 2019