Can this be done within a script?

droach

ADSM.ORG Senior Member
Joined
Jan 7, 2008
Messages
239
Reaction score
13
Points
0
Location
Cut and Shoot, Texas
I am running my reclaim as the 2nd to last job in my daily tasks without setting any duration limit. Problem is, on some days the reclaim runs so long the daily task scheduled for the next day is skipped because the previous day's schedule is still running.

Would like to be able to calculate the number of minutes left before my next day's daily task is scheduled to start, back it off about 60 minutes, and use that value within the script for duration value in the script's reclaim command.

Any suggestions?
 
Figured a way to calculate the minutes duration I want. Now if someone knows how I can work that number into my reclaim statement...

select schedule_name,timestampdiff(4,scheduled_start+24 hours - current_timestamp)-60 as Next from events where SCHEDULE_NAME='DLY_TASKS' and status='Started'

SCHEDULE_NAME NEXT
------------- -----
DLY_TASKS 732
 
I just the the daily script set the reclaimation threshold from 100 to 60. Later when the tape drives are needed for large SAP backups another script sets the threshold back to 100.
 
You can't plug the result straight into the recl stg command but this could work.

Code:
select schedule_name from events where schedule_name='DLY_TASKS' and status='Started' and timestampdiff(4,scheduled_start+24 hours - current_timestamp)-60 >= 1000
if(rc_ok) goto rclm1000
select schedule_name from events where schedule_name='DLY_TASKS' and status='Started' and timestampdiff(4,scheduled_start+24 hours - current_timestamp)-60 >= 800
if(rc_ok) goto rclm800
select schedule_name from events where schedule_name='DLY_TASKS' and status='Started' and timestampdiff(4,scheduled_start+24 hours - current_timestamp)-60 >= 600
if(rc_ok) goto rclm600
select schedule_name from events where schedule_name='DLY_TASKS' and status='Started' and timestampdiff(4,scheduled_start+24 hours - current_timestamp)-60 >= 400
if(rc_ok) goto rclm400
select schedule_name from events where schedule_name='DLY_TASKS' and status='Started' and timestampdiff(4,scheduled_start+24 hours - current_timestamp)-60 >= 200
if(rc_ok) goto rclm200
issue message w "reclaim skipped"
goto lastjob

rclm1000:
recl stg prim threshold=60 duration=500 wait=yes
recl stg copy threshold=60 duration=500 wait=yes
goto lastjob

rclm800:
recl stg prim threshold=60 duration=400 wait=yes
recl stg copy threshold=60 duration=400 wait=yes
goto lastjob

rclm600:
recl stg prim threshold=60 duration=300 wait=yes
recl stg copy threshold=60 duration=300 wait=yes
goto lastjob

rclm400:
recl stg prim threshold=60 duration=200 wait=yes
recl stg copy threshold=60 duration=200 wait=yes
goto lastjob

rclm200:
recl stg prim threshold=60 duration=100 wait=yes
recl stg copy threshold=60 duration=100 wait=yes
goto lastjob

lastjob:
issue message i "done"
 
Thanks everyone for your suggestions. I thought about doing what CoMaboy suggested, but I really didn't want to clutter up my script with all the extra lines of code. Seems silly that we can't use variable substitution to do this.

DazRaz, your suggestion would work if I only had one job left to run...but I have two reclaims that run at the end of my daily task script.
 
DazRaz, your suggestion would work if I only had one job left to run...but I have two reclaims that run at the end of my daily task script.

Not sure I understand. I do this for a number of storage pools. The daily job sets the new reclaimation limit, does subsequent jobs and finishes. The actual reclaimation is done automatically and not tied to the daily job.

The last part of my daily job looks like this

Code:
move drm * wherestate=mo tostate=courier wait=yes rem=bulk
upd stg tapepool rec=60 reclaimpr=2
upd stg offsitepool rec=60 reclaimpr=2
migrate stg file_migrate lowmig=1 wait=no
migrate stg file_archive lo=0 du=240
reclaim stg file_static th=30
reclaim stg file_static1 th=30
del sch daily_maint_part2 t=a

As you can see, I have a number of items after the upd stg <poolname> rec=60.
 
I am tape drive poor and can only afford to run my reclaims in series. Would like to set a duration for my two reclaim jobs instead of adjusting the threshold limit on the pool.
 
Back
Top