1. 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.
  2. 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.

Script to cancel all process

Discussion in 'Scripting' started by barouch, May 15, 2007.

  1. jonathan274

    jonathan274 ADSM.ORG Member

    Joined:
    May 7, 2009
    Messages:
    51
    Likes Received:
    0
    Works like a charm. One slight revision though need the pr prefixing the process variable otherwise you get an error because it will just do cancel #:

    PROC=`dsmadmc -id=userid -password=user_password -dataonly=yes "q proc" | grep "Space Reclamation" | awk '{print $1}'`

    dsmadmc -id=userid -password=user_password -dataonly=yes "cancel pr $PROC"

    thanks
     
  2. RobinIvens

    RobinIvens Active Newcomer

    Joined:
    Jan 27, 2017
    Messages:
    9
    Likes Received:
    0
    Thanks for the scripts. The problem I am having is when the numbers are in the thousands, there is a comma and the process command fails. is there a way to strip out the comma?
    1,165 Protect Stgpool Protecting storage
    ANR2020E CANCEL PROCESS: Invalid parameter - 1,165.
     
  3. bigred

    bigred ADSM.ORG Member

    Joined:
    Dec 3, 2012
    Messages:
    10
    Likes Received:
    0
    RobinIvens:

    Just do a 'sed' on it to replace the , character with nothing.

    PROC=`dsmadmc -id=userid -password=user_password -dataonly=yes "q proc" | grep "Space Reclamation" | awk '{print $1}'`
    PROC="$(echo $PROC | sed 's/,//g')"
    dsmadmc -id=userid -password=user_password -dataonly=yes "cancel pr $PROC"
     
  4. RobinIvens

    RobinIvens Active Newcomer

    Joined:
    Jan 27, 2017
    Messages:
    9
    Likes Received:
    0
    Thanks bigred !!! That worked. :) much appreciated.
     

Share This Page