TSM scripts that write to external files?

pbanghart

ADSM.ORG Member
Joined
Sep 16, 2002
Messages
40
Reaction score
0
Points
0
Website
Visit site
I was wondering if anyone has written scripts that send the output to an "external" file. For example, I want to schedule a script to run daily that will query the activity log, but I want to direct the results to a file on my AIX 5.1 system. I know I can do this though the command line, but the key is that I want to create the file from within a TSM script...is this do-able?



All feedback is appreciated!!



Regards, -PB
 
One method lots of people use to do this is to run the client in command line mode. Then pipe the results to a file. This works with all the OSes I know ( *nix, W*doze, etc ) that TSM supports. Now these are not 'administrative scripts', but it does the job.



On my W*doze TSM server, I have set up an administrative schedule that kicks off a DOS style 'batch' file to do some maintenance.



I hope this helps! ... JC
 
Thanks for the feedback. It sounds like kicking off a dos-style batch job from an admin schedule would be what I'm aiming for...how exactly do you do this? I've been ruffling through the manuals but can't quite piece it together... :confused:





-PB
 
Seems like there are some problems posting now....



AIX scripting is way more powerful than the TSM scripting, but you can combine them as you please... In my example I call one TSM script (scratch) and issue a select directly from the script.
 
Short example of AIX / Korn Shell script for TSM usage :

(This checks the amount of scratch tapes and reports any offline tape drives)





#!/usr/bin/ksh

TSMC="dsmadmc -id=userID -password=password"

clear

echo "\n_____TSM_Control_Script____________________________________"

$TSMC "run scratch" |tail -11|head -7

echo "\n_____Checks for Offline Tape drives____________________________"

$TSMC "select DRIVE_NAME from DRIVES where ONLINE='NO'"

exit 0







TSM Scratch script

-------------------------------

set sqldisplaymode wide

select count(VOLUME_NAME) as "Number of Scratch tapes in 3575L32" from LIBVOLUMES where STATUS='Scratch' and library_name='3575LIBR'

select count(VOLUME_NAME) as "Number of Scratch tapes in 3584LTO" from LIBVOLUMES where STATUS='Scratch' and library_name='IBM3584'

exit





Morten :confused:
 
Sorry for the spam but I had some problems posting..



Seems like the Code tag is not working properly
 
If you want to do some info gathering from DOS, this is an example of what we do:



:: Begin Script

:: This script uses a TSM admin account called adsmutil but it could be any admin account



::get todays date for log file name

for /f "tokens=2,3,4 delims=/ " %%i in ('date /t') do (set logdate=%%i%%j%%k)



:: Map to the TSM Server drive that contains the TSM software

:: and then change to that directory to run the dsmadmc commands



net use d: \\TSMServerName\d$

d:

cd \Progra~1\Tivoli\Tsm\baclient



:: Find TSM Server1 errors

dsmadmc -ID=adsmutil -PASSWORD=your_adsmutil_pswd -outfile="%server%\%logdir%\%logdate%ServerErr.log" q act begind=today-1 begint=16:00 search=anr9999d



:: Find Attention requests

dsmadmc -ID=adsmutil -PASSWORD=your_adsmutil_pswd -outfile="%server%\%logdir%\%logdate%attention.log" q act begind=today-1 begint=16:00 search=attention



:: anr1214i verifies that the backup process has ended and gives files/bytes backed up but it does not give the completion state

:: anr0986i provides the process number, the # of items processed, # of bytes and the completion state

::

dsmadmc -ID=adsmutil -PASSWORD=your_adsmutil_pswd q act begind=today-1 begint=16:00 search=anr0986i >> "%server%\%logdir%\%logdate%BackupState.log"

dsmadmc -ID=adsmutil -PASSWORD=your_adsmutil_pswd q act begind=today-1 begint=16:00 search=anr1214i >> "%server%\%logdir%\%logdate%BackupState.log"

dsmadmc -ID=adsmutil -PASSWORD=your_adsmutil_pswd q event * * BEGINDate=today-1 begint=16:00 enddate=today endtime=now f=d >> "%server%\%logdir%\%logdate%BackupState.log"



:: List the backup time and the bytes backed up for each server

dsmadmc -ID=adsmutil -PASSWORD=your_adsmutil_pswd q ACT BEGINDATE=TODAY-1 MSGno=4964 SEARCH=* >> "%server%\%logdir%\%logdate%Backup_stats.log"

dsmadmc -ID=adsmutil -PASSWORD=your_adsmutil_pswd q ACT BEGINDATE=TODAY-1 MSGno=4961 SEARCH=* >> "%server%\%logdir%\%logdate%Backup_stats.log"



:: End Script





Hope this helps.
 
Back
Top