Re: Script question
2002-07-09 14:36:27
Hi,
It really depends on what platform you are using. We have setup
such a script on AIX and Linux (and it should work on any other unixes).
Here is an exemple:
#!/usr/bin/ksh
/usr/tivoli/tsm/client/ba/bin/dsmadmc -id=admin -password=admin
-outfile=/usr/tivoli/tsm/server/bin/scripts/tmpfiles/checkout run
checktapes
checktapes
echo "Voici les tapes qui sont a envoyer a l'exterieur qui sont dans la
porte du LTO 3583" > /usr/tivoli/tsm/server/bin/scripts/tmpfiles/checkout2
echo "" >> /usr/tivoli/tsm/server/bin/scripts/tmpfiles/checkout2
cat /usr/tivoli/tsm/server/bin/scripts/tmpfiles/checkout| grep B00 | awk
-F" " '{print $1}'>> /usr/tivoli/tsm/server/bin/scripts/tmpfiles/checkout2
echo "" >> /usr/tivoli/tsm/server/bin/scripts/tmpfiles/checkout2
echo "" >> /usr/tivoli/tsm/server/bin/scripts/tmpfiles/checkout2
echo "Merci et bonne journee" >>
/usr/tivoli/tsm/server/bin/scripts/tmpfiles/checkout2
cat /usr/tivoli/tsm/server/bin/scripts/tmpfiles/checkout2 | grep B00 | awk
-F" " '{print $1}'| while read line ; do
/usr/tivoli/tsm/client/ba/bin/dsmadmc -id=admin -password=admin checkout
/usr/tivoli/tsm/client/ba/bin/dsmadmc -id=admin -password=admin checkout
libv 3583 $line rem=bulk checkl=no
/usr/tivoli/tsm/client/ba/bin/dsmadmc -id=admin -password=admin update vol
$line access=offsite
done
mail -s"Check Out Tapes" tsmadmins AT domain DOT com <
/usr/tivoli/tsm/server/bin/scripts/tmpfiles/checkout2
So this identifies the tapes to checkout (line2)
Then checks them out (line 8 and 9)
Then updates them to offsite (line8 and 10)
Then it emails us the results (lines 3,4,6,7 and 12)
Line 5 extratcs our tapes numbers (they all start with B00) then line 9
reads each lines with a tape number and does line 10 and 11 to each tape
in the list (checkout2) putting the tape number in place of $line.
Hope this helps and sorry for the less then clear explanations!
Etienne Brodeur
"Stephen A. Cochran" <stephen.a.cochran.lists AT CAHIR DOT NET>
Sent by: "ADSM: Dist Stor Manager" <ADSM-L AT VM.MARIST DOT EDU>
07/09/2002 11:00 AM
Please respond to "ADSM: Dist Stor Manager"
To: ADSM-L AT VM.MARIST DOT EDU
cc:
Subject: Script question
Hopefully a simple question:
I have a select script that finds the tapes I want to be processed by
MOV DRM, is there a way to pipe the results from the select back into
that command? Here's the select:
select volume_name,state from drmedia where (volume_name in (select
volume_name from volumes where status='FULL') and state='MOUNTABLE') or
volume_name in (select volume_name from libvolumes where
last_use='DbBackup')
And I want the volumes returned from that to be processed by MOV DRM.
The other option would be outputting to a tmp file and creating a
command for each volume, but that seems more complicated than it should
be.
Steve Cochran
Dartmouth College
|
|
|