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.