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@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users