#!/bin/sh # # Script to make a Bacula "rescue" disk # device=/mnt/floppy dev=/dev/fd0 # Print Usage message usage () { cat <&1 >/dev/null if [ $? = 0 ] ; then mounted=1 else mounted=0 fi mke2fs $dev mount $dev $device 2>&1 >/dev/null if [ x$make_bacula = "xyes" ] ; then ./make_static_bacula fi if [ x$copy_bacula = "xyes" -a ! -e bacula-fd ] ; then echo " " echo "bacula-fd not found. If you want Bacula on this" echo "rescue disk please run \"make_static_bacula\" first." echo "Continuing anyway ..." echo " " exit 1 have_bacula=no else echo "Stripping and compressing Bacula" strip bacula-fd gzip bacula-fd have_bacula=yes fi echo "Copying files to $device" cp -a . $device if [ x$copy_etc = "xyes" ] ; then echo "Tarring /etc files to $device" tar --create --gzip --file $device/etc.gz --files-from backup.etc.list fi if [ x$have_bacula = "xyes" ] ; then rm -f bacula-fd.gz bacula-fd.conf fi sync if [ $mounted = 0 ] ; then umount $device fi