I am running the following script for our dailybackup and and having a problem with the tape rewinding itself when it reaches the end and writing over itself. The command tctl -f /dev/rmt0 rewoffl has been placed in the script, but the tape is still rewinding instead of ejecting and asking for another tape. Any help?
# Set up Tape Unit as a variable.
#
TAPENR=/dev/rmt0
#
wall 'The system will be going to backup in 1 minute'
#
sleep 60
#
echo "Bringing down the oracle applications\n"
su applmgr /backup/appsdown
#
# wait 5 minutes for the concurrent managers to come down normally.
sleep 300
echo "Bringing down the oracle databases\n"
su oracle /backup/oradown
#
#Unmount the file systems to backup
#
unmount /home
unmount /u01
unmount /u02
unmount /u03
unmount /u04
#
#backup
echo "Backing up the system\n"
#
/usr/sbin/backup -f $TAPENR -'0' '-u' /home
/usr/sbin/backup -f $TAPENR -'0' '-u' /u01
/usr/sbin/backup -f $TAPENR -'0' '-u' /u02
/usr/sbin/backup -f $TAPENR -'0' '-u' /u03
/usr/sbin/backup -f $TAPENR -'0' '-u' /u04
# run backlist, file containing list of dir to archive
# rewind and eject the tape
tctl -f /dev/rmt0 rewoffl
#
mount -v'jfs' /dev/hd1 /home
mount -v'jfs' /dev/ora01 /u01
mount -v'jfs' /dev/ora02 /u02
mount -v'jfs' /dev/ora03 /u03
mount -v'jfs' /dev/ora04 /u04
#
echo "Bringing the oracle databases up\n"
su oracle /backup/oraup
#
# echo "Bringing up the oracle applications\n"
su applmgr /backup/appsup
#
echo "\nDone\n"
date
#
# Set up Tape Unit as a variable.
#
TAPENR=/dev/rmt0
#
wall 'The system will be going to backup in 1 minute'
#
sleep 60
#
echo "Bringing down the oracle applications\n"
su applmgr /backup/appsdown
#
# wait 5 minutes for the concurrent managers to come down normally.
sleep 300
echo "Bringing down the oracle databases\n"
su oracle /backup/oradown
#
#Unmount the file systems to backup
#
unmount /home
unmount /u01
unmount /u02
unmount /u03
unmount /u04
#
#backup
echo "Backing up the system\n"
#
/usr/sbin/backup -f $TAPENR -'0' '-u' /home
/usr/sbin/backup -f $TAPENR -'0' '-u' /u01
/usr/sbin/backup -f $TAPENR -'0' '-u' /u02
/usr/sbin/backup -f $TAPENR -'0' '-u' /u03
/usr/sbin/backup -f $TAPENR -'0' '-u' /u04
# run backlist, file containing list of dir to archive
# rewind and eject the tape
tctl -f /dev/rmt0 rewoffl
#
mount -v'jfs' /dev/hd1 /home
mount -v'jfs' /dev/ora01 /u01
mount -v'jfs' /dev/ora02 /u02
mount -v'jfs' /dev/ora03 /u03
mount -v'jfs' /dev/ora04 /u04
#
echo "Bringing the oracle databases up\n"
su oracle /backup/oraup
#
# echo "Bringing up the oracle applications\n"
su applmgr /backup/appsup
#
echo "\nDone\n"
date
#