Deleting volumes in a stg pools after cloning a TSM server on AIX

dojabergen

ADSM.ORG Member
Joined
Nov 4, 2013
Messages
35
Reaction score
2
Points
0
Hi expert!

I have really been searching for a 'solution' for my challenge, but not succeeded!

I have cloned a TSM server ver. 6.3.4 running on an AIX server.

4 primrary stg pools and their volumes had to be removed. But i want to do it by a script. I tried the flw.:

delete vol XYZ discarddata=yes
delete vol ABC discarddata=yes
delete vol EFG discarddata=yes

300 volumues all together, one at a time, in a sequential way. Since I had to confirm each 'discarddata=yes' I cannot just run the script above.

Any suggestions?
Thank you.
 
I've scripted this in the past. List of volumes goes in a file named /usr/local/tsm/bin/vollist.txt. Emails a list of volumes deleted just in case. It looked like this.

#!/bin/sh
TMPFILE=/tmp/tsm.out.`date +%s`
ID=`cat /usr/local/tsm/bin/tsm.id`
PASSWORD=`cat /usr/local/tsm/bin/tsm.pw`
DESTMAIL=<mail recipient>
#echo "From: root-<server name>" >$TMPFILE
echo "______________________________________________________________" >>$TMPFILE
echo " TSM Batch Volume Delete " >>$TMPFILE
echo "______________________________________________________________" >>$TMPFILE
echo " " >>$TMPFILE
echo " " >>$TMPFILE
for i in $(</usr/local/tsm/bin/vollist.txt)
do
dsmadmc -id=$ID -password=$PASSWORD del vol $i discarddata=yes >>$TMPFILE
done
echo " " >>$TMPFILE
mail -s "TSM Batch Volume Delete" $DESTMAIL <$TMPFILE
#more $TMPFILE
rm $TMPFILE
#echo $TMPFILE
 
I've scripted this in the past. List of volumes goes in a file named /usr/local/tsm/bin/vollist.txt. Emails a list of volumes deleted just in case. It looked like this.

#!/bin/sh
TMPFILE=/tmp/tsm.out.`date +%s`
ID=`cat /usr/local/tsm/bin/tsm.id`
PASSWORD=`cat /usr/local/tsm/bin/tsm.pw`
DESTMAIL=<mail recipient>
#echo "From: root-<server name>" >$TMPFILE
echo "______________________________________________________________" >>$TMPFILE
echo " TSM Batch Volume Delete " >>$TMPFILE
echo "______________________________________________________________" >>$TMPFILE
echo " " >>$TMPFILE
echo " " >>$TMPFILE
for i in $(</usr/local/tsm/bin/vollist.txt)
do
dsmadmc -id=$ID -password=$PASSWORD del vol $i discarddata=yes >>$TMPFILE
done
echo " " >>$TMPFILE
mail -s "TSM Batch Volume Delete" $DESTMAIL <$TMPFILE
#more $TMPFILE
rm $TMPFILE
#echo $TMPFILE


" to DazRaz
Thank you very much for this optimal script! This save me for much time and I start it during the weekend!"
 
Back
Top