• Please help support our sponsors by considering their products and services.
    Our sponsors enable us to serve you with this high-speed Internet connection and fast webservers you are currently using at ADSM.ORG.
    They support this free flow of information and knowledge exchange service at no cost to you.

    Please welcome our latest sponsor Tectrade . We can show our appreciation by learning more about Tectrade Solutions
  • Community Tip: Please Give Thanks to Those Sharing Their Knowledge.

    If you receive helpful answer on this forum, please show thanks to the poster by clicking "LIKE" link for the answer that you found helpful.

  • Community Tip: Forum Rules (PLEASE CLICK HERE TO READ BEFORE POSTING)

    Click the link above to access ADSM.ORG Acceptable Use Policy and forum rules which should be observed when using this website. Violators may be banned from this website. This notice will disappear after you have made at least 3 posts.

Scripting within TSM... Just what can be done?

Rob Stroud

ADSM.ORG Member
Joined
Dec 11, 2007
Messages
35
Reaction score
1
Points
0
Hi Guys,

I've seen some very smooth scripts on some client sites but never been able to get copies.. :(

Just what is the TSM Script 'shell?' able to do?

Loop, goto, exit, if.... Type things?

Does anyone have a function/keyword ref or at least know which sys it's based on?

I feel that this would also be a worthy area for a sticky.
 

BBB

ADSM.ORG Moderator
Joined
Feb 13, 2007
Messages
2,076
Reaction score
20
Points
0
Location
Brisbane, Australia
Tsm Scripts are *very* basic and not based on any other scripting language. You get a very very basic IF statement, Labels, and a GOTO and an EXIT and thats about it apart from SERIAL and PARALLEL.

You can do loops using an IF and a GOTO, with some sort of query or command immediately before the IF (the IF merely examines the return code of the previous command, there will be some examples on this site if you search for goto probably).

Tsm scripts can call other scripts the usual way (run <script>) but you can't embed them too far, I think 9 is the maximum depth you can call down to (vague recollection from memory)
 

ypcat

ADSM.ORG Member
Joined
Oct 30, 2007
Messages
130
Reaction score
1
Points
0
Location
Toronto Canada
TSM scripting is limited it is true but that's not to say there are any limits to scripting it...

The TSM database is a standard prioprietary relational database and accepts standard SQL statements. Using these in a script can be very powerful.

I run a 2000+ line KSH script as well as a few other smaller ones that interface with our helpdesk, management, customers and admins using all the usual UNIX stuff (sed, awk, etc) as well as automatically mailing reports to all concerned in HTML format.

In this code I use batch file mode, SQL, TSM commands, and call TSM scripts etc, all menu driven and prettied up using TPUT commands and the terminfo. :) I even have a few C programs...all culminating in almost automated push-button TSM administration under standard conditions.

TSM is awesome to script with and extremely powerful if you know it well at the command line level. I would recommend learning SQL; It is an exellent skill to have as a TSM admin.
 

BBB

ADSM.ORG Moderator
Joined
Feb 13, 2007
Messages
2,076
Reaction score
20
Points
0
Location
Brisbane, Australia
Maybe I misunderstood the question. My answer was in relation to TSM admin scripts and these are very limited as I stated, these are the ones you create using the "def script" admin command.

Otherwise, scripting for TSM with a ksh shell or perl or whatever language of your choice is really easy and loads of people do it. We have script packages with thousands of lines of code for TSM management... sure we could buy software but it wouldn't do what our scripts can do! :)
 

Rob Stroud

ADSM.ORG Member
Joined
Dec 11, 2007
Messages
35
Reaction score
1
Points
0
Thanks guys,

Does anyone know if IBM are planning or would consider expanding this capability??

At the end of the day flexibility is one of TSMs greatest strengths & a self contained scripting shell that can loop count and interact with the shell or just do something mad like:-
execute shell /tsm/dly.sh
or
audit vol $1 fix=yes | /tsm/vols.out

Just an idea but I feel that anything that can bring scripting within TSM can only make it an even more powerful product.
 
Last edited:

rchoudarapu

ADSM.ORG Senior Member
Joined
Jul 18, 2007
Messages
176
Reaction score
5
Points
0
Have a look at "Server Scripts" part of Richard Sims'

http://people.bu.edu/rbs/ADSM.QuickFacts

I too am looking forward to see more features and enhancements to the TSM scripting... However, I agree with BBB and ypcat... one can do a lot using TSM integrated with shell/perl/OS-side scripting...
 

BBB

ADSM.ORG Moderator
Joined
Feb 13, 2007
Messages
2,076
Reaction score
20
Points
0
Location
Brisbane, Australia
You can actually run an external shell script from within a TSM script as you have mentioned above, using a bit of a trick, but it works very well if you need it (I use it all the time).

Ensure that your TSM server has a TSM client node setup on it as well, and registered to the TSM server itself.

Then in your TSM script, run "def clientact <servers_nodename> ...." and I can't quite remember the rest of the flags but it would be something like: type=command obj="/tsm/dly.sh" wait=yes. You can then check the return code from the external shell script with a TSM if statement.

Scripting inside TSM isn't completely bad, no you can't do loops over volume names or whatever, but you can do some stuff using a little lateral thinking. Eg. you can have a daily maintenance tsm script that automatically handles weekends differently from weekdays.

ps. Some admins argue for using only external scripts for TSM, others only for internal, others for a combination depending on whats best for what you're trying to do.
 
Last edited:

Advertise at ADSM.ORG

If you are reading this, so are your potential customer. Advertise at ADSM.ORG right now.

DigitalOcean $100 Credit

Support ADSM.ORG and get DigitalOcean FREE credit. DigitalOcean currently offer a $100, 60-day Free Credit for new accounts. Sign-up here:

DigitalOcean Referral Badge

The Spectrum Protect TLA (Three-Letter Acronym): ISP or something else?

  • Every product needs a TLA, Let's call it ISP (IBM Spectrum Protect).

    Votes: 20 18.7%
  • Keep using TSM for Spectrum Protect.

    Votes: 65 60.7%
  • Let's be formal and just say Spectrum Protect

    Votes: 13 12.1%
  • Other (please comement)

    Votes: 9 8.4%

Forum statistics

Threads
31,871
Messages
135,906
Members
21,786
Latest member
london
Top