Script to cancel all process

PREDATAR Control23

To complete the script:

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 $PROC"

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
 
PREDATAR Control23

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.
 
PREDATAR Control23

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"
 
Top