jeremy tirrell ha realizado un excelente Script, que permite tomar instantáneas basadas en copias de seguridad con xenserver 5.5.

Este script también viene con un help de uso del script que le permite purgar la copia de seguridad después de un número fijo de horas determinadas.

La configuración está basada en varios ficheros,

backup.pl, con el contenido:

$backupdir = "/mnt/offsite/";    The directory you wish to backup to. This should be an NFS share or something rather large
#mail notification setup
$mailNotification = true; Enable Mail Notification, set to false to disable.

$MailTo = "helpdesk\@csinet.ca"; The email address you want to send notifcations to.
$MailFrom = "helpdesk\@csinet.ca"; The email address that the mail will come from (some smtp servers require this to be a valid exisiting email address.
$host = "CGL-XENServer"; The host name of the server
#Setup Strings
$Message = " \"XEN Backup Notification\n"; The fist line of the backup notifcation mail.

$TopicHeader = "[".$host ." XEN Server Backup Script] "; The topic of the email.
$Topic = "";

@skip = ('d9eac24b-887c-4e5a-a49a-2cbbf5490dd0'); This array needs to contain the uuid of your DOM0 machine and any other machines you want to skip.

purgeBackup.php

  $parseDirs = array('/backup/XEN-Backup/Admin/',
'/backup/XEN-Backup/CGL/',
'/backup/mailBackup/'); Directory's to cleanse of old backups
$backupIdentifier = 'xva'; Only grab filenames that contain this string
$days = 5; Days of backup files to keep
sendEmail
"hostname" => 'backup.whatever.com', the hostname of the server this is being run on (not required)


"server" =>'172.16.17.66', The ip address or hostname of your smtp server
crontab on nfs server
0 1 * * * /opt/purgeBackup.php >> /backup/XEN-Backup/purge.log

crontab on the XENserver

 #this runs the backup script every morning at 1 am
01 01 * * * /root/scripts/backup.pl >> /mnt/offsite/backup.log 2>&1

 

Podéis bajar el Script de este link, pulsando aquí.

Esperamos que este Script sea de utilidad e interés para todos.