OpenVZ Forum


Home » General » Support » ploop backup question - exclude delta file (Is it OK to exclude the delta file from the backup)
icon5.gif  ploop backup question - exclude delta file [message #51107] Wed, 05 February 2014 23:33 Go to next message
tomp is currently offline  tomp
Messages: 64
Registered: August 2007
Member
From: *idnet.net
Hi,

I am experimenting with ploop backup, so far all the examples just say something along the lines of:

"backup /vz/private/CTID after creating a snapshot"

Unfortunately this seems to also backup the delta file, which if there are a lot of changes happening on the container, would mean backing up potentially a lot of unnessecary data.

Is it OK instead to do:

cd /vz/private
tar czvf /root/1009.tar.gz 1009 --exclude 'root.hdd.*'

This excludes the root.hdd.{GUID} delete.

I've found that when I restore the backup, I can switch to the snapshot and delete it, it does give an error saying it can't delete the delta file (expected) but apart from that works fine.

Is there anything I should be aware of when taking this approach? Smile
Re: ploop backup question - exclude delta file [message #51322 is a reply to message #51107] Sat, 12 April 2014 16:42 Go to previous messageGo to next message
tomp is currently offline  tomp
Messages: 64
Registered: August 2007
Member
From: *idnet.net
Hi,

Does anyone have some information on this?

I want to get started with ploop, but can't really start using it until I know what the preferred way to backup a container is?

Do I need to backup the snapshot delta also?
Re: ploop backup question - exclude delta file [message #51323 is a reply to message #51107] Sat, 12 April 2014 16:44 Go to previous messageGo to next message
tomp is currently offline  tomp
Messages: 64
Registered: August 2007
Member
From: *idnet.net
I have read this page:

https://wiki.openvz.org/Ploop/Backup#Image-based_backup

Unfortunately, it just says:

# Perform a backup using your favorite backup tool
# (cp is just an example)
cp $VE_PRIVATE/root.hdd/* /backup/destination

This would copy the $VE_PRIVATE/root.hdd directory, which contains an ever growing delta file as changes are made inside the container.

Why would we need to back this up?

Re: ploop backup question - exclude delta file [message #51407 is a reply to message #51107] Fri, 09 May 2014 15:21 Go to previous message
luzifer2222 is currently offline  luzifer2222
Messages: 2
Registered: May 2014
Location: Germany
Junior Member
From: *pools.arcor-ip.net
Hey tomp,

I have also this problem and I hope we could get help here.
I append my snapshot script and my point of view here.

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: Snapshotscript Ploop/Backup
Next Topic: vzctl exec cron not working
Goto Forum:
  


Current Time: Mon Nov 20 03:37:50 GMT 2017