1. Forum Rules (PLEASE CLICK HERE TO READ BEFORE POSTING) Click the link 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 message will disappear after you have made at least 12 posts. Thank you for your cooperation.

cancel all reclaim processes

Discussion in 'Scripting' started by BaukePlugge, Sep 10, 2004.

  1. BaukePlugge

    BaukePlugge New Member

    Joined:
    Sep 10, 2004
    Messages:
    4
    Likes Received:
    0
    Hi there,



    I'm looking for an admin script or server command script to cancel all active reclaim processes.



    I've find some threads in the old site but their all Unix related. I've a windows based TSM 5.1 server.



    does somebody have a script for this ?



    regards

    Bauke Plugge
     
  2.  
  3. custew

    custew New Member

    Joined:
    May 8, 2004
    Messages:
    91
    Likes Received:
    0
    If you can install Perl, you might try something like this. I don't see why this wouldn't work

    on a Windows server with Perl installed.



    #!/usr/bin/perl

    #Get the password from another file so we don't have to have it hard coded in all these

    #scripts.

    open(IN,"/home/curtst/.TSM");

    chomp($pw=<IN>);



    #Look for reclaim process and kill them.

    @reclaims=grep/Reclam/,`dsmadmc -id=id -pass=$pw q pro`;

    foreach $line(@reclaims){

    $line=~s/,//g;

    @split=split(/ +/,$line);

    print "killing reclaim proccess $split[1]\n";

    sleep 2;

    `dsmadmc -id=id -pass=$pw can pro $split[1]`;

    }
     
  4. BaukePlugge

    BaukePlugge New Member

    Joined:
    Sep 10, 2004
    Messages:
    4
    Likes Received:
    0
    is there no other alternative?



    I prefer to do it with TSM self.



    regards

    Bauke Plugge
     
  5. custew

    custew New Member

    Joined:
    May 8, 2004
    Messages:
    91
    Likes Received:
    0
    Not that I've figured out. That's why I just use Perl.



    Curtis





    <TABLE BORDER=0 ALIGN=CENTER WIDTH=85%><TR><TD><font class="pn-sub">Quote:</font><HR></TD></TR><TR><TD><FONT class="pn-sub"><BLOCKQUOTE>is there no other alternative?



    I prefer to do it with TSM self.



    regards

    Bauke Plugge</BLOCKQUOTE></FONT></TD></TR><TR><TD><HR></TD></TR></TABLE>
     
  6. jkloek

    jkloek New Member

    Joined:
    Dec 28, 2002
    Messages:
    19
    Likes Received:
    0
    Occupation:
    Unix Admin
    Location:
    Memphis, TN
    Just for fun:

    for a in `dsmadmc -pass=xxxx -id=xxxx "select process_num from processes where process='Migration' " |sed 1,12d | sed -e :a -e '$d;N;2,4ba' -e 'P;D' `

    do

    dsmadmc -pass=xxxx -id=xxxx "cancel pr $a"

    done
     
  7. BaukePlugge

    BaukePlugge New Member

    Joined:
    Sep 10, 2004
    Messages:
    4
    Likes Received:
    0
    Sorry but where can i put in this script ?



    If I do it in admin scripts then I get an error when I save it.



    thanks for the responses for so far.



    regards

    Bauke Plugge
     
  8. custew

    custew New Member

    Joined:
    May 8, 2004
    Messages:
    91
    Likes Received:
    0
    Now why didn't I think of that? Much easier than parsing the process numbers out of a query process command. Good thought.



    Curtis



    <TABLE BORDER=0 ALIGN=CENTER WIDTH=85%><TR><TD><font class="pn-sub">Quote:</font><HR></TD></TR><TR><TD><FONT class="pn-sub"><BLOCKQUOTE>Just for fun:

    for a in `dsmadmc -pass=xxxx -id=xxxx "select process_num from processes where process='Migration' " |sed 1,12d | sed -e :a -e '$d;N;2,4ba' -e 'P;D' `

    do

    dsmadmc -pass=xxxx -id=xxxx "cancel pr $a"

    done



    </BLOCKQUOTE></FONT></TD></TR><TR><TD><HR></TD></TR></TABLE>
     
  9. custew

    custew New Member

    Joined:
    May 8, 2004
    Messages:
    91
    Likes Received:
    0
    I'd run it out of cron, or just manually whenever you need it. Not sure if there's a way to run OS scripts from within a TSM Administrative Schedule. Of course, neither of these will work for you without installing either Perl (http://www.activeperl.com/) for my script or either BASH or KSH (not sure which) for the last recommendation. Perhaps this (www.cygwin.com) can help you on that end.



    Curtis
     
  10. MALT

    MALT New Member

    Joined:
    Mar 14, 2003
    Messages:
    8
    Likes Received:
    0
    This is a great script but how do you modify it to loop?

    Thanks,

    Marty
     
  11. custew

    custew New Member

    Joined:
    May 8, 2004
    Messages:
    91
    Likes Received:
    0
    Not sure what you mean. Both the scripts already loop through any processes that match the requirement and kill them all. If you're concerned that reclaimation will start up again, just update the storage pools so the reclaim % is 100 as part of the script.



    Curtis



    <TABLE BORDER=0 ALIGN=CENTER WIDTH=85%><TR><TD><font class="pn-sub">Quote:</font><HR></TD></TR><TR><TD><FONT class="pn-sub"><BLOCKQUOTE>This is a great script but how do you modify it to loop?

    Thanks,

    Marty</BLOCKQUOTE></FONT></TD></TR><TR><TD><HR></TD></TR></TABLE>
     
  12. BaukePlugge

    BaukePlugge New Member

    Joined:
    Sep 10, 2004
    Messages:
    4
    Likes Received:
    0
    How can I put this script in a Admin script ?



    for a in `dsmadmc -pass=xxxx -id=xxxx "select process_num from processes where process='Migration' " |sed 1,12d | sed -e :a -e '$d;N;2,4ba' -e 'P;D' `

    do

    dsmadmc -pass=xxxx -id=xxxx "cancel pr $a"

    done





    regards

    Bauke
     

Share This Page