Re: ontape
Posted in 1996
Stefan P. Romankiw wrote:
>
> I am in the process of putting together backup procedures using the =
> ontape utility. If you have scripts that you use that automates you =
> daily backup procedures, I would be interested in getting a copy of your =
> scripts. =20
>
> Thanks.
>
> Steve Romankiw
> Executive Risk Inc.
Here's my script. I run it everynight by cron. Hope it helps!
Any reccomendations to make it better gladly acctepted!
# Title: backup
# Author Juan R. Guzman
# Date: 7/18/1996
# Objective: Script detects if this is primary or secondary server.
# If Primary then perform ontape, if secondary perform Unix backup
#
#####################################################################
## Set Informix vars
#####################################################################
INFORMIXDIR=/opt/informix
INFORMIXHOME=/u/informix
INFORMIXLOG=$INFORMIXHOME/log
INFORMIXSERVER=`uname -n`shm#####################################################################
## Set general vars
#####################################################################
NODENAME=`uname -n`
USERS="user1 user2"
export INFORMIXDIR INFORMIXHOME INFORMIXSERVER INFORMIXLOG USERSNODENAME
#####################################################################
## Is this is primary or secondary?
#####################################################################
SERVERTYPE=`cat $INFORMIXLOG/servertype`
#
#
banner $NODENAME > /tmp/arc.log
#
#####################################################################
# If server is primary then do ontape, if secondary then do unix backup
#####################################################################
if [ "$SERVERTYPE" = "Seconda" ]
then
. /u/trc/sysadmin/scripts/ubkup
else
echo '0\\n' | $INFORMIXDIR/bin/ontape -s | head -14 >> /tmp/arc.log
2>&1
for i in $USERS
do
mail ${i}@yourdomain.com < /tmp/arc.log
done
fi
#####################################################################
## End of Script
#####################################################################