script to run using dsmadmc command

jbautista

ADSM.ORG Member
Joined
Apr 11, 2007
Messages
306
Reaction score
2
Points
0
hi all,

we just moved TSM 6.3 from AIX to Linux environment. Now we have to do some cleaning to our new environment. we don't want to run each command over and over to do things so we are wondering if there are scripts guru out there who can help to accomplish the ff:

1. we want to delete all the volumes that was created in AIX as it is offline status now in Linux and it is empty as we migrate all the disk data to tape before migration to Linux. we will redefine the volume location and sizes as well. so in tsm command line we will do it as: "delete volume volumename discard=yes". we want to put it into script because we have a ton a volumes and we want to avoid issuing the command x number of times just to delete everything. i have an idea on how to do it but i dont know how to put it together as i'm not into scripting:
it will be like;
dsmadmc -id=admin -password=password for i= 1 to 50 delete volume /diskforwin/stg(i) discard=yes wait=no end for

2. update the path of all the drives from /dev/rmtx to /dev/stx
3. define all new volumes


any help will be appreciated


thanks in advance
 
For (1) above:

Running the script in Linux (I believe this is where the volumes needing to be deleted are):

#!/bin/ksh

for i in `cat vol_list.txt`
do
dsmadmc -id=<admin_ID> -pa=<Admin_PW> -dataonly=yes -noc "delete volume $i discard=yes"
done

Execute this as root or the instance owner in the Linux server.

For (2)

1. Generate a list which contains the drive name and the new path associated with it. Save it to a file, say, path.txt

should look something like:

drive01 /dev/stx1
drive02 /dev/stx2
etc

2. As root or the instance owner:

#!/bin/ksh

{ while read line; do
dsmadmc -id=<admin_ID> -pa=<Admin_PW> -dataonly=yes -noc "update path <TSM_server_name> `cat $line|awk '{print $1}'` srctype=server desttype=drive device=`cat $line|awk '{print $2}'` library=<library_name> online=yes"
done } < path.txt

For (3):

What volumes? Tape? Disk?

Disclaimer:

I have not tested this script - experiment with a small sample before you do a full blown 'execute'.
 
Thanks Ed

It's a disk

For item 3, i think we can use the define volume command using the "numberofvolumes" parameter.

Yes we will try it with a small number first before full blown

Thanks again,
 
Back
Top