Bacula-users

Re: [Bacula-users] VirtualFull

2012-07-12 09:29:59
Subject: Re: [Bacula-users] VirtualFull
From: Jose Blanco <jblanco AT dth DOT com>
To: James Harper <james.harper AT bendigoit.com DOT au>, "bacula-users AT lists.sourceforge DOT net" <bacula-users AT lists.sourceforge DOT net>
Date: Thu, 12 Jul 2012 08:27:03 -0500
I think we both are using bacula in a very similar way. My offsite storage is 
only to be used in case of catastrophe. I too make a copy of the catalog and 
bacula configuration files to the external HD. I also add an Ubuntu live CD 
image just in case. Thanks for your script. I'm confident I'll be able to 
modify it a bit for my purposes.

-----Original Message-----
From: James Harper [mailto:james.harper AT bendigoit.com DOT au] 
Sent: Wednesday, July 11, 2012 9:18 PM
To: Jose Blanco; bacula-users AT lists.sourceforge DOT net
Subject: RE: VirtualFull

I have a backup_catalog_pre and backup_catalog_post scripts. The _pre script 
just calls the catalog backup script so it can be backed up by the job. The 
_post script is on the end of this email. It gathers any volumes associated 
with jobs in the offsite pool and purges them. Then for good measure it also 
copies the bsr file to the media.  I use postgresql, you'd need to rewrite it a 
bit to use mysql etc.

After the script runs, bacula will have no memory of the jobs on the offsite 
media and so will not choose them as a source for any VirtualFull jobs. In my 
case, needing to restore from offsite media would be because the backup server 
was completely wiped out so a catalog restore is required in that case anyway.

At some point I would also like to copy my bacula configs and even static 
binaries to the USB media as part of the job, but I haven't done that yet. Even 
better would be making the USB backup drive bootable too, although that is more 
effort to maintain.

James

#!/bin/bash

/etc/bacula/scripts/delete_catalog_backup

/usr/bin/psql -Atc "
SELECT DISTINCT VolumeName
FROM Job
JOIN Pool
ON Job.PoolId = Pool.PoolId
JOIN JobMedia
ON Job.JobId = JobMedia.JobId
JOIN Media
ON JobMedia.MediaId = Media.MediaId
WHERE Pool.Name = 'offsite';
" | while read media
do
  #echo Purging $media
  echo "purge volume=$media" | /usr/bin/bconsole >/dev/null 2>/dev/null done

cp /var/lib/bacula/BackupCatalog.bsr /backup/offsite

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users

<Prev in Thread] Current Thread [Next in Thread>