Hope I'm not just being obvious here, maybe I'm missing something implied in your question. The script below will return:
0 - success
1 - couldn't unmount the file system
2 - backup failed
3 - couldn't mount the file system afterwards
[tt]
#!/bin/ksh
FS=$1; shift # get the name of the filesystem from the command line
umount $FS
rc=$?
if [[ $rc != 0 ]]
then
exit 1
fi
/usr/sbin/backup -f'/dev/rmt0' -'0' $FS
rc=$?
if [[ $rc != 0 ]]
then
exit 2
fi
mount $FS
rc=$?
if [[ $rc != 0 ]]
then
exit 3
fi
exit 0
[/tt]
Anyone see any typos? (I'm at home, no unix here (yet))
Mike
michael.j.lacey@ntlworld.com
Email welcome if you're in a hurry or something -- but post in tek-tips as well please, and I will post my reply here as well.
Look at using the <fuser -k> command to kill processes that have a filesystem/LV open (or maybe to simply identify those processes) - this is if normal application shutdown does not work. I give Oracle the time that the DBA's request, then if Oracle is still not down, then the processes are killed so that I may unmount the filesystems.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.