Simpler Navigation for Servers and Operating Systems - Please Update Your Bookmarks
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
If you have bookmarked forums or discussion boards in Servers and Operating Systems, we suggest you check and update them as needed.
Operating System - Tru64 Unix
cancel
Showing results for 
Search instead for 
Did you mean: 

Use two tape drive ...

ALPHA_10
Advisor

Use two tape drive ...


Hi All
I have problem, I need make data base backup but my script only use one tape and I need two drive, fisrt one tape and them two drive in the same backup ....

1. How can I use two drive, this is script
2. Why when finish backup not show error
3. Why when finish no show the promp only stay like loop or frozen

# filename: /backup/script/osbackup
#
# This script will back up the Oracle and SAP executables
# to tape device rmt0h using the AdvFS vdump utility.
#
# Prerequisites: write-enabled tapes in drive rmt0.
#
# The SAP instance must be shutdown to perform this backup
#
INSTANCENAME=Hola
ADMACCT=tgsfd
LOGFILE=/backup/log/bdofflinebkpTape1.log
TAPE=/dev/rmt1h
NR_TAPE=/dev/rmt1h

#
# Resetting the log file for backup
#
if [ -f $LOGFILE ]
then
#mv $LOGFILE ${LOGFILE}.old
mv $LOGFILE ${LOGFILE}_OLD_`date +"%Y%m%d_%a"`
touch $LOGFILE
fi
echo "Ready to start backup at `date`" >> $LOGFILE
echo >>$LOGFILE

/sbin/vdump -0 -v -u -N -F 64 -b 64 -f $NR_TAPE /oracle/SP1/sapdata4 >>$LOGFILE 2>&1
/sbin/vdump -0 -v -u -N -F 64 -b 64 -f $NR_TAPE /oracle/SP1/sapdata5 >>$LOGFILE 2>&1
/sbin/vdump -0 -v -u -N -F 64 -b 64 -f $NR_TAPE /oracle/SP1/sapdata6 >>$LOGFILE 2>&1
/sbin/vdump -0 -v -u -N -F 64 -b 64 -f $NR_TAPE /oracle/SP1/sapdata7 >>$LOGFILE 2>&1
/sbin/vdump -0 -v -u -N -F 64 -b 64 -f $NR_TAPE /oracle/SP1/sapdata8 >>$LOGFILE 2>&1
/sbin/vdump -0 -v -u -N -F 64 -b 64 -f $NR_TAPE /oracle/SP1/sapdata9 >>$LOGFILE 2>&1
/sbin/vdump -0 -v -u -N -F 64 -b 64 -f $NR_TAPE /oracle/SP1/sapdata10 >>$LOGFILE 2>&1
/sbin/vdump -0 -v -u -N -F 64 -b 64 -f $NR_TAPE /oracle/SP1/sapdata11 >>$LOGFILE 2>&1
/sbin/vdump -0 -v -u -N -F 64 -b 64 -f $NR_TAPE /oracle/SP1/sapdata12 >>$LOGFILE 2>&1
/sbin/vdump -0 -v -u -N -F 64 -b 64 -f $NR_TAPE /oracle/SP1/sapdata13 >>$LOGFILE 2>&1
/sbin/vdump -0 -v -u -N -F 64 -b 64 -f $NR_TAPE /oracle/SP1/sapdata14 >>$LOGFILE 2>&1
/sbin/vdump -0 -v -u -N -F 64 -b 64 -f $NR_TAPE /oracle/SP1/sapdata15 >>$LOGFILE 2>&1

echo -n "Unmounting tape..."
mt -f $TAPE offline
echo "Done."
echo "backup finished at " `date` >>$LOGFILE

echo "Please remove tapes from system" >>$LOGFILE
exit


4 REPLIES
Ivan Ferreira
Honored Contributor

Re: Use two tape drive ...

>>> 1. How can I use two drive, this is script

I'm not sure about your request, do you want to run the backups to two tape drives at the same time?

If so, you need to declare two tape drives, for example NR_TAPE0 and NR_TAPE1, then send half of the backups to each device.

>>> 2. Why when finish backup not show error

All information is registered to:
LOGFILE=/backup/log/bdofflinebkpTape1.log

>>> 3. Why when finish no show the promp only stay like loop or frozen

Probably is hang in "mt -f $TAPE offline" comment that line or check the log file. Maybe is requesting to mount another media!!


Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Mark Poeschl_2
Honored Contributor

Re: Use two tape drive ...

I'm a little confused by your question. Are you trying to use two tape drives - each with a separate cartridge in it, or two tape cartridges in sequence in the same tape drive?

Are you running the script from an interactive login session or in the background - as in a cron job? vdump will stop and wait for a second tape cartridge indefinitely if the first cartridge gets filled. A prompt is generated, but in a cron job there's no way to see or respond to it. That might explain your "frozen" behavior.

If you actually have two drives each with a separate cartridge you might change your script to be something like:

INSTANCENAME=Hola
ADMACCT=tgsfd
LOGFILE=/backup/log/bdofflinebkpTape1.log
TAPE=/dev/rmt1h
NR_TAPE1=/dev/rmt1h
NR_TAPE2=/dev/rmt2h
#
# Resetting the log file for backup
#
if [ -f $LOGFILE ]
then
#mv $LOGFILE ${LOGFILE}.old
mv $LOGFILE ${LOGFILE}_OLD_`date +"%Y%m%d_%a"`
touch $LOGFILE
fi
echo "Ready to start backup at `date`" >> $LOGFILE
echo >>$LOGFILE

/sbin/vdump -0 -v -u -N -F 64 -b 64 -f $NR_TAPE1 /oracle/SP1/sapdata4 >>$LOGFILE 2>&1
/sbin/vdump -0 -v -u -N -F 64 -b 64 -f $NR_TAPE1 /oracle/SP1/sapdata5 >>$LOGFILE 2>&1
/sbin/vdump -0 -v -u -N -F 64 -b 64 -f $NR_TAPE1 /oracle/SP1/sapdata6 >>$LOGFILE 2>&1
/sbin/vdump -0 -v -u -N -F 64 -b 64 -f $NR_TAPE1 /oracle/SP1/sapdata7 >>$LOGFILE 2>&1
/sbin/vdump -0 -v -u -N -F 64 -b 64 -f $NR_TAPE1 /oracle/SP1/sapdata8 >>$LOGFILE 2>&1
/sbin/vdump -0 -v -u -N -F 64 -b 64 -f $NR_TAPE1 /oracle/SP1/sapdata9 >>$LOGFILE 2>&1
/sbin/vdump -0 -v -u -N -F 64 -b 64 -f $NR_TAPE2 /oracle/SP1/sapdata10 >>$LOGFILE 2>&1
/sbin/vdump -0 -v -u -N -F 64 -b 64 -f $NR_TAPE2 /oracle/SP1/sapdata11 >>$LOGFILE 2>&1
/sbin/vdump -0 -v -u -N -F 64 -b 64 -f $NR_TAPE2 /oracle/SP1/sapdata12 >>$LOGFILE 2>&1
/sbin/vdump -0 -v -u -N -F 64 -b 64 -f $NR_TAPE2 /oracle/SP1/sapdata13 >>$LOGFILE 2>&1
/sbin/vdump -0 -v -u -N -F 64 -b 64 -f $NR_TAPE2 /oracle/SP1/sapdata14 >>$LOGFILE 2>&1
/sbin/vdump -0 -v -u -N -F 64 -b 64 -f $NR_TAPE2 /oracle/SP1/sapdata15 >>$LOGFILE 2>&1

echo -n "Unmounting tape..."
mt -f $NR_TAPE1 offline
mt -f $NR_TAPE2 offline
echo "Done."
echo "backup finished at " `date` >>$LOGFILE

echo "Please remove tapes from system" >>$LOGFILE
exit
Ivan Ferreira
Honored Contributor

Re: Use two tape drive ...

The only problem is that the script still runs sequentially, so you should create two scripts and run them sumultaneously, one for DRIVE 1 and one for DRIVE 2.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Steven Schweda
Honored Contributor

Re: Use two tape drive ...

> [...] Are you trying to use two tape
> drives [...]

That's what I assumed when I read it. VMS
BACKUP lets the user specify multiple output
devices:

http://h71000.www7.hp.com/doc/732FINAL/aa-pv5mh-tk/00/01/127-con.html#commandformatsformultiplebackupoutputdevices

I don't see anything in the vdump docs which
suggests that it can do this, so I'd guess
that manually splitting the job among the
tape drives may be the best you can do
without additional software. (I know
nothing, but I assume that someone sells a
backup product which is smarter than vdump.)