[Veritas-bu] Script for automatic off site rotation
2003-08-08 04:56:20
Subject: |
[Veritas-bu] Script for automatic off site rotation |
From: |
Dave Markham" <dave.markham AT fjserv DOT net (Dave Markham) |
Date: |
Fri, 8 Aug 2003 09:56:20 +0100 |
I do exactly that with this script and run it from cron at a rough time when
backups will finish. It wont run unless they have anyway. You could also run
it manually if you like. Theres a usage too.
#!/bin/ksh
#
#Dave Markham
#
#Version History
#1.0 Mini Automove to just give tapes used in backup. Called from
backup_exit_notify
#1.1 Added while loop to not run unless all jobs finished
SCHEDNAME=$1
HOURS=$2
MAILFILE=/tmp/backupmail
> $MAILFILE
usage()
{
echo "\nUsage: autocheck <schedule_name> <hoursago>\n"
}
if [ "$1" = "" ] || [ "$2" = "" ]
then
usage
exit
fi
while [ 1 ] # want to loop until jobs finish
do
prc=`ps -ef | grep bpsched | grep -v grep | wc -l`
[ $prc -eq 0 ] && break
#echo "still running "
sleep 120 # sleep 2 minutes
done
echo "DONT FORGET TO CHECK NO TAPE WRITING AS BACKUPS MAY NOT HAVE
FINISHED\n\n" >> $MAILFILE
echo "Tapes used for $SCHEDNAME schedule are:\n" >>$MAILFILE
/usr/openv/netbackup/bin/admincmd/bpverify -p -sl $SCHEDNAME -hoursago
$HOURS | awk '/^Media/ {print $4}' >> $MAILFILE
mailx -s "`uname -n` Production Backup Tapes `date`" someone AT somewhere DOT
com
some-ops AT somewhere DOT com <$MAILFILE
---------------------------------------------------------------------------
----- Original Message -----
From: "Sharma, Dayanand (GEI, GEFA, Contractor)" <Dayanand.Sharma AT ge DOT com>
To: <veritas-bu AT mailman.eng.auburn DOT edu>
Sent: Thursday, August 07, 2003 9:45 PM
Subject: [Veritas-bu] Script for automatic off site rotation
>
> Hi,
>
> I am looking for a script that would identify the tapes (weekly full
> backups) to be sent off-site and automatically mail the Tape Operators
with
> the list of tapes to be ejected and shipped off-site. Any pointers will be
> highly appreciated !
>
> TIA
> Dayanand
> _______________________________________________
> Veritas-bu maillist - Veritas-bu AT mailman.eng.auburn DOT edu
> http://mailman.eng.auburn.edu/mailman/listinfo/veritas-bu
|
|
|