This script assumes that the DEFINE SERVER command has run and that the LAN-Free agent has been successfully defined on the TSM Server.
This works only on all versions of the Storage Agent and has been tested on AIX versions 5 to 6.
ASSUMPTIONS:
- dsmadmc is located in /usr/tivoli/tsm/client/ba/bin
- The TSM administrator account is admin and this account's password is admin12
- The Storage Agents are define with names of the format sta_HOSTNAME
#!/bin/ksh
* -----------------------------------------------------------------------------------------------------------
DSMADMC=/usr/tivoli/tsm/client/ba/bin/dsmadmc
ID=admin
PASSW=admin12
STAGENT=sta_`hostname`
* -----------------------------------------------------------------------------------------------------------
# Delete all tape and library devices.
for i in `lsdev -Cc tape | cut -f1 -d' '`; do
rmdev -dl $i
done
# Detect tape and library hardware - run ConfigManager
cfgmgr -v
for i in `lsdev -Cc tape | grep rmt | cut -f1 -d' '`; do
DR_SERIAL=`lscfg -vl $i | grep Serial | tr -s '. \+' ' ' | cut -f4 -d' '`
DRV=`$DSMADMC -id=$ID -pa=$PASSW -datao=y "select drive_name from drives where drive_serial=$DR_SERIAL"`
$DSMADMC -id=$ID -pa=$PASSW "def path $STAGENT $DRV srct=serv destt=dr libr=lib3584 devi=/dev/$i"
done
* -----------------------------------------------------------------------------------------------------------
No comments:
Post a Comment