DRM Script during Reclamation

jordan

ADSM.ORG Member
Joined
Jan 9, 2006
Messages
82
Reaction score
0
Points
0
Website
Visit site
Hi,



How do I make sure that there is no reclamation running on the offsite stg pool during drm script schedule?





thanks,

Jordan
 
Cron job. I wrote a simple bash script to run at 9:00 every morning.
 
#!/usr/bin/ksh



dsmadmc -id={admin} -password={password} select stgpool_name as Storage_Pool from stgpools where pooltype='COPY' and recl_running='YES'



If [[ $? = 0 ]]

then

echo "Reclaim running"

exit

fi



-Aaron
 
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



***************************************************************

***************************************************************
 
Dan,

You might also consider setting reclamation to 100 for your offsite pools and then manually resetting it after the DRM scripts run.

You could also leave it at 100 and just run "move data" against selected media that have been offsite for some predetermined amount of time or which meets other criteria you deem significant.



cheers,

Neil
 
Back
Top