WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-users

[Xen-users] Re: Xen backup

To: Bas Tichelaar <bas@xxxxxxxxxx>
Subject: [Xen-users] Re: Xen backup
From: Christoph Purrucker <cp+ml-xen@xxxxxxxx>
Date: Tue, 31 Oct 2006 00:02:52 +0100
Cc: xen-users@xxxxxxxxxxxxxxxxxxx
Delivery-date: Thu, 02 Nov 2006 13:48:10 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <EDE2DEE4-267C-4953-B5CE-F5EF33850694@xxxxxxxxxx>
List-help: <mailto:xen-users-request@lists.xensource.com?subject=help>
List-id: Xen user discussion <xen-users.lists.xensource.com>
List-post: <mailto:xen-users@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
References: <EDE2DEE4-267C-4953-B5CE-F5EF33850694@xxxxxxxxxx>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 1.5.0.7 (Windows/20060909)
Hello Bas,

At the xen-users mailinglist I saw you use LVM2 snapshotting for your Xen DomU's. You said you have a script that covers errors. Could you please send me your backup script or point me in the right direction? Also, which versions do you use (kernel, xen, etc)?

I nearly forgot you, sorry! Here is my script. It's anything but beautiful (the reader can change that and post it back here) but it does it's job.

System: Debian Etch
Xen: 3.0.2-3 (xen-3.0-x86_32)
Kernel: 2.6.16-2-xen-k7
LVM version:     2.02.06 (2006-05-12)
  Library version: 1.02.08 (2006-07-17)
  Driver version:  4.5.0

Please note: rdiff-backup will only be started, if there is a file called 'backup' in the partition's root directory.

cu cp


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#!/bin/sh

broot=/backup
vg=/dev/xenlvm
p="--print-statistics"

for h in $vg/*-disk
do
   d=`echo $h | awk -F'/' '{print $3"/"$4}'`
   echo -n "$d ... "
   date
   if lvcreate -l 10 --snapshot --name snap $h
   then mount $vg/snap /mnt
   fi
   if [ $? -eq 0 ]
   then
      if [ -f /mnt/backup ]
      then /usr/bin/rdiff-backup $p $* /mnt/            $broot/$d/
      else echo "NOTE: I should not backup this one!"
      fi
   else echo "ERROR: Snapshot wasn't mountable!"
   fi
   sleep 1
   umount /mnt
   sleep 1
   lvremove -f $vg/snap
   sleep 1
   echo
   /usr/bin/rdiff-backup --remove-older-than 4W $broot/$h/
   echo "________________________________________________________"
   echo
done
date

_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-users] Re: Xen backup, Christoph Purrucker <=