LVM Using snapot to backup data–from google searching..

This is a Daily script

#!/bin/bash
DIR=/root/backup
BACKUP_CMD=backup-lv.sh

VG=/dev/vg1 #whichever folder your xen files located at)
LV[0]=xen-1 # (name of diff, xen machines/guests)
LV[1]=xen-2
LV[2]=xen2-data #xen2 is a web server with large amount of data
LV[3]=xen-3

cd $DIR
COUNT=0
CAT_STR=""
while [ $COUNT -lt ${#LV[@]} ]
do
./$BACKUP_CMD $VG/${LV[$COUNT]} &> last-backup-${LV[$COUNT]}
CAT_STR="${CAT_STR} last-backup-${LV[$COUNT]}"
MOO=$((COUNT++))
done

ls -lh /mnt/system_backups/ &> last-backup-ls
cat $CAT_STR last-backup-ls > last-backup.txt
echo "daily backup report attached" | mutt -s "$HOSTNAME daily backup report" -a last-backup.txt MyEmail@MyCompany.com

Continue reading “LVM Using snapot to backup data–from google searching..”