1. Please help support our sponsors by considering their products and services.
    Our sponsors enable us to maintain high-speed Internet connection and fast webservers.
    They support this free information and knowledge exchange forum service at no cost to you.

    Please welcome our latest sponsor Tectrade . We can show our appreciation by learning more about Tectrade Solutions

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:
    13
    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