#!/bin/sh
###############################################################
#
# Shell Script: bk-vygr-dl0
# Backup Voyager database, dump level 0
# 1998 & 1999, Michael Doran, doran@uta.edu
# University of Texas at Arlington Libraries
#
###############################################################
# Check for tape:
/usr/bin/mt -f /dev/rmt/0cb status
if [ $? -ne 0 ] # If no tape
then
exit 1 # abort the backup.
fi
# shut down servers
/etc/init.d/dbora stop
/etc/init.d/httpd stop
# run "savecritical" script (per Voyager Technical Manual)
/m1/utility/savecritical
# Unmount the Voyager file system
/usr/sbin/umount /m1
if [ $? -ne 0 ] # If not successful
then
# kill processes that are using Voyager resources
/usr/sbin/fuser -c -k /m1
# and try again to unmount
/usr/sbin/umount /m1
# If it still won't unmount...
if [ $? -ne 0 ]
then
# restart the Voyager and Web Servers, ...
/etc/init.d/dbora start
/etc/init.d/httpd start
/etc/init.d/voyager start
# abort the backup.
exit 1
fi
fi
# Do backup
/usr/sbin/ufsdump 0ucvf /dev/rmt/0cb /dev/md/rdsk/d0
# Remount the Voyager file system
/usr/sbin/mount /m1
# Did the Voyager file system remount?
if [ $? -ne 0 ] # If not...
then
# reboot system.
/usr/sbin/init 6
exit 1
else # If yes...
# restart the Voyager and Web servers.
/etc/init.d/dbora start
/etc/init.d/httpd start
/etc/init.d/voyager start
# Did Voyager restart?
if [ $? -ne 0 ]
# If not...
then
# reboot system.
/usr/sbin/init 6
exit 1
fi
fi
# and exit script.
exit 0