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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ONTAPE Redirection

Status
Not open for further replies.

cobdeng

MIS
Oct 14, 2004
19
GB
Hi

I have the following script which runs an ONTAPE backup.
Having recently installed a New Tape Drive (/dev/rmt/1m)
can somebody advise how to redirect ontape to send the backup to the new Tape drive.

Just changing 0m to 1m in the following statement
mt -f /dev/rmt/0m rew 2> /tmp/tape.check
has no effect - when the ontape statement runs, it still searches for a tape in the default drive (0m)

Any assistance greatly appreciated

SCRIPT:-

export INFORMIXDIR=/usr/informix
export ONCONFIG=onconfig.live
export INFORMIXSERVER=ONLINELIVE
export SERVERNUM=0
export KAIOON=1

# Make sure that the tape check file is not there already
rm -f /tmp/tape.check 2> /dev/null

# Rewind whatever is in the tape drive and output any error message
mt -f /dev/rmt/0m rew 2> /tmp/tape.check

# If an error message has been recorded then abort backup
if [ -s /tmp/tape.check ]
then
rm -f /tmp/tape.check 2> /dev/null
cat /home/informix/files/notape.live | mail backup
else
rm -f /tmp/tape.check 2> /dev/null
echo '\n' | $INFORMIXDIR/bin/ontape -s -L 0 | head -n 100 | mail
backup
fi
## Now clear down the logical logs
echo "\ny\n"| $INFORMIXDIR/bin/ontape -a
## Now free any unallocated virtual memory segments
$INFORMIXDIR/bin/onmode -F

END OF SCRIPT

Thanks foryour help

Gary
 
Gary,
I It looks like you may need to change the value of LTAPEDEV in your onconfig file. I usually have mine set to a file that is a softlink to the actual device. This comes in handy should the tape device die in the middle of a restore. You don't have to restart ontape to change devices.

Corey
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top