Re: Accessing remote tape drive
Posted in 1997
This is a multi-part message in MIME format.
--------------691F60E27F83
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Marco Greco wrote:
>
> On 7 Jul 1997, Richard Stanford wrote:
>
> [snip]
> > Er, this only applies for logical backups (ie: continuous logging).
> > You can
> > change TAPEDEV at any time without requiring an engine bounce.
> >
> > -Richard
>
> Ooops! Still, it would be nice not having to tamper with on/tbconfig
> just to select
> a different tape drive to back up to
>
Try the attached script. It prompts for level and device (defaulting to
the value in ONCONFIG file. (It also reads lists of databases to which
logging is to be added or removed.)
--------------691F60E27F83
Content-Type: text/plain; charset=us-ascii; name="fbnews"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="fbnews"
#! /usr/bin/ksh
date
. tm
drv=`egrep '^TAPEDEV' $INFORMIXDIR/etc/$ONCONFIG`
drv=${drv##*/}
drv=${drv%%#*}
echo
read ndrv?" Enter drive on which tapes are mounted (1c -or- 2c)(default: ${drv}): "
if [[ -z $ndrv ]]; then ndrv=${drv}; fi
if [[ $ndrv != $drv ]]
then
cp -p $INFORMIXDIR/etc/$ONCONFIG $INFORMIXDIR/etc/$ONCONFIG.prev
sed "/^TAPEDEV/s/$drv/$ndrv /" <$INFORMIXDIR/etc/$ONCONFIG >$INFORMIXDIR/etc/$ONCONFIG.new
mv $INFORMIXDIR/etc/$ONCONFIG.prev $INFORMIXDIR/etc/$ONCONFIG.last
mv $INFORMIXDIR/etc/$ONCONFIG.new $INFORMIXDIR/etc/$ONCONFIG
fi
read level?"Enter Archive level (0/1/2)(default: 0): "
if [[ -z $level ]]; then level=0; fi
ans=no
if [[ $level -eq 0 && (-f ~informix/AddLogs || -f ~informix/DropLogs) ]]; then
echo Changes to the logging status of one or more databases is requested.
echo Need to bring Informix to QUIESCENT MODE to set database logging.
echo This will kill all processes attached to Informix.
echo
read ans?'Do you want to set database logging status as requested?'
if [[ $ans = [yY]* ]]; then
echo Defering Logging Status changes to next Archive!
fi
fi
if [[ $ans = [yY]* ]]; then
echo Bringing Engine to QUIESCENT mode. Mark `uname -n` off.
echo Dbdwn and rstrt the Bloomberg environment after archive finishes.
LogDBs=""
if [[ $level -eq 0 && -f ~informix/AddLogs ]]; then
LogDBs=${LogDBs} -U
for db in `cat ~informix/AddLogs`; do
LogDBs="$LogDBs $db"
done
mv ~informix/AddLogs ~informix/AddLogs.done
touch AddLogs.done
fi
if [[ $level -eq 0 && -f ~informix/DropLogs ]]; then
LogDBs=${LogDBs} -N
for db in `cat ~informix/DropLogs`; do
LogDBs="$LogDBs $db"
done
mv ~informix/DropLogs ~informix/DropLogs.done
touch DropLogs.done
fi
onmode -uy
onmode -c
echo ontape -s -L ${level} $LogDBs
ontape -s -L ${level} $LogDBs echo Archive complete. Bringing Informix back to ONLINE mode.
onmode -my echo Informix is back ONLINE. You may rstrt the Bloomberg environment.
else
echo ontape -s -L ${level}
ontape -s -L ${level}fi
date
--------------691F60E27F83--