[Veritas-bu] moving media between pool
2003-11-05 10:42:02
Hi,
I use this scripts to change any Volume Pool that media expire to go to
Volumne pool "Scratch"
more /usr/openv/netbackup/bin/scratch.sh
#!/bin/ksh
clear
#echo "Entre com o pool number do pool Scratch (para verificar isso, de um
vmpool)"
#read POOLNUMBER
echo "------------------------------------------------------"
date
POOLNUMBER=$1
CONTADOR=1
pool=0
/usr/openv/netbackup/bin/admincmd/bpmedialist -l >/tmp/bpmlist.txt
/usr/openv/volmgr/bin/vmquery -b -a >/tmp/vmquery.txt
T=`wc -l /tmp/vmquery.txt|awk '{print $1}'`
TAPESTOTAL=`expr $T - 3`
TAPESASS=`wc -l /tmp/bpmlist.txt|awk '{print $1}'`
tail -$TAPESTOTAL /tmp/vmquery.txt|awk '{print $1}' >/tmp/vmtotal.txt
awk '{print $1}' /tmp/bpmlist.txt>/tmp/assigned.txt
echo "Total de fitas auditadas pelo Netbackup: $TAPESTOTAL" >
/tmp/lista.fita
echo "Total de fitas assigned................: $TAPESASS" >> /tmp/lista.fita
TAPESCRATCH=1
while [ $CONTADOR -le $TAPESTOTAL ]
do
ID=`awk 'NR == '$CONTADOR /tmp/vmtotal.txt`
/usr/openv/volmgr/bin/vmquery -m $ID>/tmp/query.txt
ASSQUERY=`cat /tmp/query.txt|awk 'NR == 13'|awk '{print $2}'`
POOLQUERY=`cat /tmp/query.txt|awk 'NR == 6'|awk '{print $3}'`
if [ $ASSQUERY = "---" ]
then
if [ $POOLQUERY != "Scratch" ]
then
echo A MIDIA ID: $ID PERTENCENTE AO POOL: $POOLQUERY
ESTA EXPIRADA!
#echo "DESEJA ALTERA-LA PARA SCRATCH???? (S/N)???"
#read ANSWER
#if [ $ANSWER = "s" ]
# then
/usr/openv/volmgr/bin/vmchange -p
$POOLNUMBER -m $ID
echo FITA TROCADA PARA SCRATCH
TAPESCRATCH=`expr $TAPESCRATCH + 1`
#fi
fi
fi
CONTADOR=`expr $CONTADOR + 1`
done
echo "Total de fitas movidas p/ scratches.....: $TAPESCRATCH" >>
/tmp/lista.fita
pool=`/usr/openv/volmgr/bin/vmquery -b -pn Scratch |grep DLT | wc -l`
echo "Total de Fitas em Scratch...............: $pool" >> /tmp/lista.fita
echo "----------------------------------------------------" >>
/tmp/lista.fita
for i in `cat /usr/openv/netbackup/lista.email1`
do
mailx -s "Audit de fitas do netbackup - " $i < /tmp/lista.fita
done
cat /tmp/lista.fita
echo "----------------------------------------------------"
Message: 7
From: "Donaldson, Mark" <Mark.Donaldson AT experianems DOT com>
To: "'Feroz F. Basir'" <dbase77 AT yahoo DOT com>
Cc: veritas-bu AT mailman.eng.auburn DOT edu
Subject: RE: [Veritas-bu] moving media between pool
Date: Tue, 4 Nov 2003 10:34:14 -0700
Note, only media that hasn't been assigned (no backups on it) can have its
pool changed.
-M
-----Original Message-----
From: Feroz F. Basir [mailto:dbase77 AT yahoo DOT com]
Sent: Tuesday, November 04, 2003 10:02 AM
To: scott.kendall AT abbott DOT com
Cc: veritas-bu AT mailman.eng.auburn DOT edu
Subject: Re: [Veritas-bu] moving media between pool
Hi,
Thank you for replying. I read vmchange manual and can
you comfirm this is the correct syntax to move media
between pool.
vmchange -h hostname -p pool_num -m mediaid
to get pool_num run "vmpool -listall"
Thank you again.
regards,
Feroz Basir
|
|
|