-Original Message-
From: James Healy [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 22, 2002 12:09 PM
To: [EMAIL PROTECTED]
Subject: Script to do housekeeping
Has anyone written a script with sequential dependant steps that does daily
housekeeping?
I have most of my daily housekeeping administrative schedules kiccking off
by time of day schedules but there are too many variables that can cause
them to get out of sync.
Im looking for a script that will do something like this:
check backup: check to see if daily client backup is done
if yes
run migration to tape, if no loop back to check backup
check migration: check to see if migration is complete
if yes
backup tape: backup all tape pools to copy pools if no loop back to check
migration
Check backup tape: check to see if backup tape is completed
if yes
backup db:
Check backup db
if yes
move drm if no loop back to check dbackup db
Hello James,
Here are the scripts that I run that does most of what you are
asking. I'm doing pretty much what you want with a few variations. You
should be able to adapt them to your needs. As long as you use the WAIT-YES
parameter things will run serially quite nicely.
Take care,
Al
Alan Davenport
Senior Storage Administrator
Selective Insurance
[EMAIL PROTECTED]
(973) 948-1306
Name Line Command
Number
-- --
DAILY_MAI- 1 expi i quiet=y
NT
6 ba stg directorypool copy_directories maxpr=2
wait=yes
11 ba stg backuppool copyvault maxpr=6 wait=yes
16 upd stg backuppool highm=10 lowm=0
21 delete sch migrate_check t=a
26 def sch migrate_check t=a cmd='run migrate_check'
startt=now+0:10 active=y perunits=onetime
Name Line Command
Number
-- --
MIGRATE_C- 1 select * from processes where process='Migration'
HECK
6 if(rc_ok) goto resch
11 delete sch migrate_check t=a
16 run daily_maint2
21 exit
26 resch:
28 q stg backuppool
31 delete sch migrate_check t=a
36 def sch migrate_check t=a cmd='run migrate_check'
startt=now+0:10 active=y perunits=onetime
Name Line Command
Number
-- --
DAILY_MAI- 10 ba stg tapepool copyvault maxpr=3 wait=yes
NT2
20 run daily_maint3
Name Line Command
Number
-- --
DAILY_MAI- 1 del sch daily_maint3 t=a
NT3
6 select distinct(dayname(date_time)) from actlog
where
dayname(current_date)='Saturday'
11 if (rc_notfound) goto not_sat
16 ba db t=f devc=cartvault wait=yes
21 if (rc_ok) goto db_done
26 goto retry
31 not_sat:
36 ba db t=f devc=cartridge wait=yes
41 if (rc_ok) goto db_done
46 goto retry
51 db_done:
56 prepare planprefix=adsm.server.recvplan wait=yes
61 backup volhist
66 backup devconfig
71 del volhist todate=-21 type=all
76 run emptyvaultreturn
81 upd vol * access=offsite wherestgpool=copyvault
wherestatus=full whereaccess=readwrite
86 del sch daily_maint3 t=a
91 def sch daily_maint3 t=a cmd='run endreclaim'
startt=now+4
active=y perunits=onetime
96 run startreclaim
101exit
106retry:
111del sch daily_maint3 t=a
116def sch daily_maint3 t=a cmd='run daily_maint3'
startt=now+0:01 active=y perunits=onetime
Name Line Command
Number
-- --
STARTRECL- 1 /* start tape reclamation */
AIM
10 /* both cart and vault */
15 run reclaimcount
20 upd stgp copyvault reclaim=67
30 upd stgp tapepool reclaim=67