Results 1 to 5 of 5
Thread: Decision scripting in TSM
-
06-14-2012, 09:13 AM #1Member
- Join Date
- Jan 2009
- Posts
- 132
- Thanks
- 0
- Thanked 0 Times in 0 Posts
Decision scripting in TSM
Hi All,
I am looking for some information on decision syntax in TSM scripting. This is what I am planning to do, I want to write a script that can check what day of the week is it and base on the day will excute a certain set of command.
Anybody can provide some clue?
Thanks in advance.
-
06-14-2012, 09:34 AM #2Moderator
- Join Date
- Aug 2005
- Location
- Somewhere in the US
- Posts
- 5,296
- Thanks
- 2
- Thanked 137 Times in 135 Posts
Windows or Unix?
Script must be done outside of TSM.Ed
-
06-14-2012, 10:05 AM #3Member
- Join Date
- Jan 2009
- Posts
- 132
- Thanks
- 0
- Thanked 0 Times in 0 Posts
Windows. Do you think you can provide some example?
-
06-14-2012, 10:24 AM #4Moderator
- Join Date
- Aug 2005
- Location
- Somewhere in the US
- Posts
- 5,296
- Thanks
- 2
- Thanked 137 Times in 135 Posts
@echo off
set DAY=%DATE:~0,3%
set COMD=dsmadmc -id=admin -pa=passsword -noc -dataonly=yes
IF %DAY% equ Mon (
%COMD% "some TSM command in double quotes"
)
IF %DAY% equ Tue (
%COMD% "some TSM command in double quotes"
)
etc...Ed
-
06-14-2012, 10:46 AM #5Senior Member
- Join Date
- Dec 2004
- Location
- NC
- Posts
- 200
- Thanks
- 0
- Thanked 11 Times in 11 Posts
What follows applies to TSM 5.5.x. I don't know about 6.x. But in 5.5.x you can use a command like
select dayofweek(current_timestamp) from status
to return a number from 1 (Sunday) to 7 (Saturday) and build some logic around that.
So something like what follows will return either an rc_ok if true or rc_notfound if false (example is looking for Sunday)
select server_name from status where dayofweek(current_timestamp)=1
And you can expand this into a TSM script along the lines of this
select server_name from status where dayofweek(current_timestamp)=1
if(rc_notfound) goto next1
<insert your commands here>
goto exit
next1:
select server_name from status where dayofweek(current_timestamp)=2
if(rc_notfound) goto next2
<insert your commands here>
goto exit
next2:
..... <etc>
exit:
exit"If we knew what it was we were doing, it would not be called research, would it?" -- Albert Einstein
Similar Threads
-
Scripting TSM Backup
By mensah in forum ScriptingReplies: 2Last Post: 03-12-2012, 04:14 PM -
TSM scripting
By newguy538 in forum ScriptingReplies: 7Last Post: 06-15-2009, 12:03 PM -
Scripting within TSM... Just what can be done?
By Rob Stroud in forum ScriptingReplies: 7Last Post: 05-27-2008, 09:03 AM -
TSM scripting
By spiffy in forum ScriptingReplies: 3Last Post: 11-03-2007, 09:33 AM -
Decision Support Tool
By mbotticelli in forum Backup / Archive DiscussionReplies: 0Last Post: 05-28-2003, 10:57 PM


Reply With Quote