I wonder if anyone can help. We have just installed a new TSM server with a new library. The library is an IBM TS3200 library with 3 IO slots. I have a script that I have borrowed off our other TSM server which identifies tapes with a status of mountable and then it moves them to the IO slots and change the status of the tape. I am going to include the script below. There are a couple of issues we have with the new tape library and the script. The first is that if the server has more than 3 tapes with a state of mountable the script has to be run through a couple of times to get all the tapes out. I am wondering if anyone can suggest a better way of doing this. It has to be as simple as possible as our helpdesk get the tapes out. The second problem is that the process is slow as the library checks the tape by mounting it in a drive before ejecting it, I thought it would be much quicker just to scan the barcode but am unsure how to make it do this. We do not have the problem with the other library and server that I borrowed the script off as that library has 12 io slots i.e. 1 complete magazine.
Thanks in advance.
script below
REM *** Move tapes from library and vault and list them
@echo off
set drm_dir="c:\drm\tapemoves"
set TSMSRV=localhost
set ID=xxxx
set PASSWD=xxxx
set DRMSOURCE=DBBackup
cd /d %drm_dir%
rem Control txt file
copy tovault13.txt tovault14.txt
copy tovault12.txt tovault13.txt
copy tovault11.txt tovault12.txt
copy tovault10.txt tovault11.txt
copy tovault9.txt tovault10.txt
copy tovault8.txt tovault9.txt
copy tovault7.txt tovault8.txt
copy tovault6.txt tovault7.txt
copy tovault5.txt tovault6.txt
copy tovault4.txt tovault5.txt
copy tovault3.txt tovault4.txt
copy tovault2.txt tovault3.txt
copy tovault1.txt tovault2.txt
copy tovault.txt tovault1.txt
cls
c:
cd \tivoli\tsm\baclient
echo ================================================== ===========
echo *************** Number of tapes to be ejected ***************
echo ================================================== ===========
dsmadmc -tcpserveraddr=%TSMSRV% -id=%ID% -pass=%PASSWD% q drm wherestate=mountable source=%DRMSOURCE%
echo.
echo.
ECHO Make a note of the number of tapes to be ejected.
ECHO Do you wish to continue ?:
ECHO Y Continue
ECHO N Quit
ECHo C Cancel
ECHO.
CHOICE /C YNC /M "Press Y for Yes, N for No or C for Cancel."
IF ERRORLEVEL == 3 GOTO QUIT
IF ERRORLEVEL == 2 GOTO END
IF ERRORLEVEL == 1 GOTO EJECT
:EJECT
echo ================================================== ===========
echo Identify and move tapes from MOUNTABLE to COURIER (going out)
echo ================================================== ===========
dsmadmc -tcpserveraddr=%TSMSRV% -id=%ID% -pass=%PASSWD% MOVE DRMEDIA * WHERESTATE=MOUNTABLE SOURCE=%DRMSOURCE% TOSTATE=COURIER APPEND=NO WAIT=YES REMOVE=UNTILEEFULL
echo "Outgoing tapes to VAULT" >> c:\drm\tapemoves\tovault.txt
dsmadmc -tcpserveraddr=%TSMSRV% -id=%ID% -pass=%PASSWD% QUERY DRMEDIA * WHERESTATE=COURIER SOURCE=%DRMSOURCE% FORMAT=STANDARD APPEND=NO >> c:\drm\tapemoves\tovault.txt
dsmadmc -tcpserveraddr=%TSMSRV% -id=%ID% -pass=%PASSWD% MOVE DRMEDIA * WHERESTATE=COURIER SOURCE=%DRMSOURCE% TOSTATE=VAULT APPEND=NO WAIT=YES REMOVE=UNTILEEFULL
rem pause
echo.
echo.
echo.
echo ================================================== ===========
echo *************** Are all the tapes ejected? ******************
echo ================================================== ===========
echo.
ECHO Choose an option:
ECHO Y Finish Ejecting
ECHO N Continue Ejecting
ECHO.
echo.
echo.
echo.
echo.
CHOICE /C YNC /M "Press Y for Yes, N for No or C for Cancel."
IF ERRORLEVEL == 3 GOTO QUIT
IF ERRORLEVEL == 2 GOTO EJECT
IF ERRORLEVEL == 1 GOTO END
:END
dsmadmc -tcpserveraddr=%TSMSRV% -id=%ID% -pass=%PASSWD% -OUT=c:\drm\tapemoves\dr_tapes.txt "select volume_name,stgpools.stgpool_name from volumes,stgpools where volumes.stgpool_name=stgpools.stgpool_name and stgpools.pooltype='COPY' and( status='FULL' or status='FILLING') order by 2"
dsmadmc -tcpserveraddr=%TSMSRV% -id=%ID% -pass=%PASSWD% -OUT=c:\drm\tapemoves\db_backup.txt "select volume_name from volhistory where type='BACKUPFULL' and cast((current_timestamp-date_time)hours as decimal(8,0)) < 24"
CLS
echo.
echo.
echo.
echo ================================================== =====
echo *********** LIST OF DR TAPES AVAILABLE AT: ************
ECHO c:\drm\tapemoves\dr_tapes.txt
ECHO c:\drm\tapemoves\db_backup.txt
echo ================================================== =====
echo.
echo.
echo.
GOTO STOP
:QUIT
echo.
echo.
echo.
echo ================================================== ====
echo *********** TAPES HAVE NOT BEEN EJECTED **************
ECHO ----- Please check with your TSM administrator -------
echo ================================================== ====
:STOP
pause
Thanks in advance.
script below
REM *** Move tapes from library and vault and list them
@echo off
set drm_dir="c:\drm\tapemoves"
set TSMSRV=localhost
set ID=xxxx
set PASSWD=xxxx
set DRMSOURCE=DBBackup
cd /d %drm_dir%
rem Control txt file
copy tovault13.txt tovault14.txt
copy tovault12.txt tovault13.txt
copy tovault11.txt tovault12.txt
copy tovault10.txt tovault11.txt
copy tovault9.txt tovault10.txt
copy tovault8.txt tovault9.txt
copy tovault7.txt tovault8.txt
copy tovault6.txt tovault7.txt
copy tovault5.txt tovault6.txt
copy tovault4.txt tovault5.txt
copy tovault3.txt tovault4.txt
copy tovault2.txt tovault3.txt
copy tovault1.txt tovault2.txt
copy tovault.txt tovault1.txt
cls
c:
cd \tivoli\tsm\baclient
echo ================================================== ===========
echo *************** Number of tapes to be ejected ***************
echo ================================================== ===========
dsmadmc -tcpserveraddr=%TSMSRV% -id=%ID% -pass=%PASSWD% q drm wherestate=mountable source=%DRMSOURCE%
echo.
echo.
ECHO Make a note of the number of tapes to be ejected.
ECHO Do you wish to continue ?:
ECHO Y Continue
ECHO N Quit
ECHo C Cancel
ECHO.
CHOICE /C YNC /M "Press Y for Yes, N for No or C for Cancel."
IF ERRORLEVEL == 3 GOTO QUIT
IF ERRORLEVEL == 2 GOTO END
IF ERRORLEVEL == 1 GOTO EJECT
:EJECT
echo ================================================== ===========
echo Identify and move tapes from MOUNTABLE to COURIER (going out)
echo ================================================== ===========
dsmadmc -tcpserveraddr=%TSMSRV% -id=%ID% -pass=%PASSWD% MOVE DRMEDIA * WHERESTATE=MOUNTABLE SOURCE=%DRMSOURCE% TOSTATE=COURIER APPEND=NO WAIT=YES REMOVE=UNTILEEFULL
echo "Outgoing tapes to VAULT" >> c:\drm\tapemoves\tovault.txt
dsmadmc -tcpserveraddr=%TSMSRV% -id=%ID% -pass=%PASSWD% QUERY DRMEDIA * WHERESTATE=COURIER SOURCE=%DRMSOURCE% FORMAT=STANDARD APPEND=NO >> c:\drm\tapemoves\tovault.txt
dsmadmc -tcpserveraddr=%TSMSRV% -id=%ID% -pass=%PASSWD% MOVE DRMEDIA * WHERESTATE=COURIER SOURCE=%DRMSOURCE% TOSTATE=VAULT APPEND=NO WAIT=YES REMOVE=UNTILEEFULL
rem pause
echo.
echo.
echo.
echo ================================================== ===========
echo *************** Are all the tapes ejected? ******************
echo ================================================== ===========
echo.
ECHO Choose an option:
ECHO Y Finish Ejecting
ECHO N Continue Ejecting
ECHO.
echo.
echo.
echo.
echo.
CHOICE /C YNC /M "Press Y for Yes, N for No or C for Cancel."
IF ERRORLEVEL == 3 GOTO QUIT
IF ERRORLEVEL == 2 GOTO EJECT
IF ERRORLEVEL == 1 GOTO END
:END
dsmadmc -tcpserveraddr=%TSMSRV% -id=%ID% -pass=%PASSWD% -OUT=c:\drm\tapemoves\dr_tapes.txt "select volume_name,stgpools.stgpool_name from volumes,stgpools where volumes.stgpool_name=stgpools.stgpool_name and stgpools.pooltype='COPY' and( status='FULL' or status='FILLING') order by 2"
dsmadmc -tcpserveraddr=%TSMSRV% -id=%ID% -pass=%PASSWD% -OUT=c:\drm\tapemoves\db_backup.txt "select volume_name from volhistory where type='BACKUPFULL' and cast((current_timestamp-date_time)hours as decimal(8,0)) < 24"
CLS
echo.
echo.
echo.
echo ================================================== =====
echo *********** LIST OF DR TAPES AVAILABLE AT: ************
ECHO c:\drm\tapemoves\dr_tapes.txt
ECHO c:\drm\tapemoves\db_backup.txt
echo ================================================== =====
echo.
echo.
echo.
GOTO STOP
:QUIT
echo.
echo.
echo.
echo ================================================== ====
echo *********** TAPES HAVE NOT BEEN EJECTED **************
ECHO ----- Please check with your TSM administrator -------
echo ================================================== ====
:STOP
pause