On 03/02/12 06:02, Wassim Zaarour wrote: > Hi List, > > We are backing up to disks not tapes, now I need to set up a plan in case > the bacula server (director) crashes. > What to do in case the MySQL catalog is lost? Can we recover? I guess it is > easy to keep copy of configuration files to install on a new system but what > about the catalog? > > What is the best plan for the server's disaster recovery? > Thanks.
Hi Wassim... I have modified the catalog job's "Run Before" script so that the database dump file created is uniquely named with a date/time stamp, bacula-YYYYmmddD-HHMMSS.sql like so: bacula_catalog_dump.sh: --[snip]-- NOW=$(date +%Y%m%d-%H%M%S) BINDIR="/usr/bin" DUMPDIR="/var/lib/bacula/catalog-dumps" ${BINDIR}/mysqldump -u ${2}${MYSQLPASSWORD}${MYSQLHOST} -f \ --opt $1 > ${DUMPDIR}/${1}-${NOW}.sql --[snip]-- I have also modified the catalog job's "Run After" script to delete catalog dump files that are more than "x" days old so I always have a few spares in that directory in case of a database failure/corruption: # ls /var/lib/bacula/catalog-dumps bacula-20120229-033205.sql bacula-20120301-033849.sql bacula-20120302-035022.sql bacula_catalog_delete.sh: --[snip]-- #!/bin/bash db_name=bacula dump_dir="/var/lib/bacula/catalog-dumps" days_to_keep="2" find ${dump_dir} -daystart -type f -mtime +${days_to_keep} \ -name "${db_name}-*.sql" -exec rm -f {} \; --[snip]-- The catalog dump is backed up nightly as part of the catalog job of course, and the the /var/lib/bacula/catalog-dumps and /etc/bacula directories are rsync'ed daily to another remote server in case of the type of disaster you have described. If there were an issue with the database, I'd always have several recent catalogs locally that I could restore from. And if there were an issue with the database and the /var partition (or the whole server etc) the recent catalogs and the bacula configuration files would be available via two scp commands after the backup server rebuild. Hope this helps. -- Bill Arlofski Reverse Polarity, LLC ------------------------------------------------------------------------------ Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ _______________________________________________ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users