Results 1 to 5 of 5
  1. #1
    Member
    Join Date
    Jan 2009
    Posts
    150
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default 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.

  2. #2
    Moderator moon-buddy's Avatar
    Join Date
    Aug 2005
    Location
    Somewhere in the US
    Posts
    5,967
    Thanks
    4
    Thanked 236 Times in 231 Posts

    Default

    Windows or Unix?

    Script must be done outside of TSM.
    Ed

  3. #3
    Member
    Join Date
    Jan 2009
    Posts
    150
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Windows. Do you think you can provide some example?

  4. #4
    Moderator moon-buddy's Avatar
    Join Date
    Aug 2005
    Location
    Somewhere in the US
    Posts
    5,967
    Thanks
    4
    Thanked 236 Times in 231 Posts

    Default

    @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

  5. #5
    Senior Member
    Join Date
    Dec 2004
    Location
    NC
    Posts
    200
    Thanks
    0
    Thanked 12 Times in 11 Posts

    Default

    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

  1. Scripting TSM Backup
    By mensah in forum Scripting
    Replies: 2
    Last Post: 03-12-2012, 05:14 PM
  2. TSM scripting
    By newguy538 in forum Scripting
    Replies: 7
    Last Post: 06-15-2009, 01:03 PM
  3. Scripting within TSM... Just what can be done?
    By Rob Stroud in forum Scripting
    Replies: 7
    Last Post: 05-27-2008, 10:03 AM
  4. TSM scripting
    By spiffy in forum Scripting
    Replies: 3
    Last Post: 11-03-2007, 10:33 AM
  5. Decision Support Tool
    By mbotticelli in forum Backup / Archive Discussion
    Replies: 0
    Last Post: 05-28-2003, 11:57 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •