Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automated Backup Script

Status
Not open for further replies.

bopritchard

Programmer
Jan 27, 2003
199
US
Here's my problem I've attempting to backup a db to my tape library...problem is the backup runs across 3 tapes and the backup routine doesn't know how to swap the tape out and keep going...

when the tape fills...the backup continually retries until it sees a new tape in its drive...it also writes

"Please mount tape 1 on /dev/rmt/c4t0d0BEST and press Return to continue ... could not write archive tape."

to an ontape.out file...

i use an mc command to actually load the new tape when i see this message in the ontape.out...then everything keeps running

you see the problem...this is far from being automated...

what i need is something that checks for existance of that "mount tape" message in that file then runs that mc command to swap the tape and keep going
 
os=HPUX 10.20
server=HP 9000
tape=HP DLT 7000 1/8, 8 slot single drive library
db=Informix 7.24

thanks
 
[tt]#!/bin/ksh

QUITFILE=/tmp/quitfile
QUIT=0
REST=5

LOGFILE=ontape.out
LOOKFOR="mount tape"

while test ${QUIT} -eq 0
do
FLAG=`tail -1 ${LOGFILE} | grep "${LOOKFOR}" | wc -l`
if test ${FLAG} -gt 0
then
mc whatever
fi
if test -f ${QUITFILE}
then
QUIT=1
fi
sleep ${REST}
done
[/tt]

Start this in the background (via & or "at now"), then touch the quitfile to make it die off.

Edit as necessary.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top