We use the following: this is the macro to update the actual macro: ------------------ delete script reclaim_check def script reclaim_check desc='Check if space reclamation is finished' upd script reclaim_check "select * from processes where process='Space Reclamation'" upd script reclaim_check 'if(rc_ok) goto resch' upd script reclaim_check 'delete schedule reclaim_check t=a' upd script reclaim_check 'run set_reclaim_primary 100' upd script reclaim_check 'run set_reclaim_copy 100' upd script reclaim_check "select * from script_names where name='DO_RECLAIM_STOP'" upd script reclaim_check 'if(rc_ok) goto stop' upd script reclaim_check 'exit' upd script reclaim_check 'resch:' upd script reclaim_check 'delete schedule reclaim_check t=a' upd script reclaim_check "define schedule reclaim_check t=a cmd='run reclaim_check' -" upd script reclaim_check ' startt=now+0:15 dur=15 duru=m per=1 peru=h active=yes' upd script reclaim_check 'exit' upd script reclaim_check 'stop:' upd script reclaim_check 'rename script do_reclaim_stop do_reclaim_ok' ------------------ This has a few points. The macro that starts reclaim does several things: 1)starts reclaim using macro set_reclam_copy 55 and set_reclaim_primary 45, 2) creates a schedule for script reclaim_check above, and 3) creates a schedule for the macro reclsim_stop (used to try and stop reclaim after so many hours, set copy and primary pools to 100 reclaim).
The heart of it bolls down to the following: do a select and see if processes are still running. if they are then delete this schedule and create a new one in the future and end this macro - see first select and resch: in above macro if here then process is finished: delete this schedule and do what you must for next step which is usually start next process and create checker schedule for it. We have a complete set of these that does the daily processing. They each start a process and schedule a checker to watch for it to finish. The checker keeps scheduling itself until the process is finished. Then it runs the next step process which in turn creates a checker schedule. This continues until we do reclaim which is our last one. Thus in the above macro, you do not see the start of a new step because reclaim is our last. The processes are as follows: do backup primary disk to tape copy do backup primary tape to tape copy do backup the database do migrate do expire do reclaim They all follow the design of the above script. -- Phillip Ford Senior Software Specialist Corporate Computer Center Schering-Plough Corp. (901) 320-4462 (901) 320-4856 FAX [EMAIL PROTECTED] -----Original Message----- From: Loon, E.J. van - SPLXM [mailto:[EMAIL PROTECTED]] Sent: Friday, August 02, 2002 6:00 AM To: [EMAIL PROTECTED] Subject: Housekeeping through a TSM script Hi TSM-ers! At this moment al my maintenance processing is scheduled at specific hours. I'm thinking about creating a script which starts all maintenance, one after the other. The only problem I have is that I cannot find a way to see if reclamation has finished. Most of the administrative task have the wait=yes parameter, so the script waits until the task is finished, but since you schedule reclamation through the update stgpool command one can't use that trick here. I thought about issuing a q proc command every 10 minutes and capturing the return code 11 (no processes found) but a sleep 600 or something like that is not supported in a TSM script. Does anybody else have an idea how to do this? AIX scripts are not an option due to security reasons (userid and passwords in the script). Thanks in advance! Kindest regards, Eric van Loon KLM Royal Dutch Airlines ********************************************************************** For information, services and offers, please visit our web site: http://www.klm.com. This e-mail and any attachment may contain confidential and privileged material intended for the addressee only. If you are not the addressee, you are notified that no part of the e-mail or any attachment may be disclosed, copied or distributed, and that any other action related to this e-mail or attachment is strictly prohibited, and may be unlawful. If you have received this e-mail by error, please notify the sender immediately by return e-mail, and delete this message. Koninklijke Luchtvaart Maatschappij NV (KLM), its subsidiaries and/or its employees shall not be liable for the incorrect or incomplete transmission of this e-mail or any attachments, nor responsible for any delay in receipt. ********************************************************************** *************************************************************** This message and any attachments is solely for the intended recipient. If you are not the intended recipient, disclosure, copying, use, or distribution of the information included in this message is prohibited -- please immediately and permanently delete this message.