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
Hey Guys,

I need help with the Snapshot-script.
I take this script to do my snapshots:
#!/bin/bash

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

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

#create BACKUP-PATH
/bin/mkdir -p $BACKUPPATH

# Known snapshot ID
ID=$(uuidgen)
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  )

done

chmod 600 /raid/.backup_vz

echo "BACKUP FINISHED."

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: Mon Jul 22 15:36:21 GMT 2024

Total time taken to generate the page: 0.02360 seconds