Just gonna pinch your select for a second Aaron
Do you want the DRM to wait for the rec to finish or do you want to cancel the recs?
####
##
There may be a syntax error or something as I am not logged in to check it mate, if there is let me know...
Start 1-2 of your copy pools recs and test, it is harmless to try
##
####
If you want to wait for it to cancel start your script with this
***************************************************************
***************************************************************
#!/usr/bin/ksh
REC_COUNT=`dsmadmc -id={admin} -password={password} "select stgpool_name as Storage_Pool, recl_running from stgpools where pooltype='COPY' and recl_running='YES'"|grep -v "Server command"|grep YES|wc -l`
while [[ $REC_COUNT -ne "0" ]]
do
sleep 120
REC_COUNT=`dsmadmc -id={admin} -password={password} "select stgpool_name as Storage_Pool, recl_running from stgpools where pooltype='COPY' and recl_running='YES'"|grep -v "Server command"|grep YES|wc -l`
done
## Now put the code for your DRM script here
***************************************************************
***************************************************************
if you want to cancel the recs first
Then do something like this
#!/usr/bin/ksh
REC_COUNT=`dsmadmc -id={admin} -password={password} "select stgpool_name as Storage_Pool, recl_running from stgpools where pooltype='COPY' and recl_running='YES'"|grep -v "Server command"|grep YES|wc -l`
while [[ $REC_COUNT -ne "0" ]]
do
COPYPOOL=`dsmadmc -id={admin} -password={password} "select stgpool_name recl_running from stgpools where pooltype='COPY' and recl_running='YES'"|grep -v "Server command"|grep YES|awk '{print $1}'`
if [[ $? -eq "0" ]]
then
for POOL in $COPYPOOL
do
dsmadmc -id={admin} -password={password} "upd stg ${POOL} rec=100"
REC_PROC=`dsmadmc -id={admin} -password={password} "select process_num, process from processes where process='Space Reclamation' and status like '%${POOL}%' "|grep -v "Server command"|grep "Space Reclamtion|awk '{print $1}'`
REC_CHECK=`echo "$REC_PROC"|wc -l`
if [[ $REC_CHECK -gt "0" ]]
then
for PROCID in $REC_PROC
do
dsmadmc -id={admin} -password={password} "can proc ${PROCID}"
done
fi
done
fi
REC_COUNT=`dsmadmc -id={admin} -password={password} "select stgpool_name as Storage_Pool, recl_running from stgpools where pooltype='COPY' and recl_running='YES'"|grep -v "Server command"|grep YES|wc -l`
done
## Now put the code for your DRM script here
***************************************************************
***************************************************************