ADSM-L

Script to do housekeeping

2015-10-04 17:12:14
Subject: Script to do housekeeping
From: James Healy [mailto:James.Healy AT AXACS DOT COM]
To: ADSM-L AT VM.MARIST DOT EDU
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.
I"m 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
alan.davenport AT selectvie DOT com
(973) 948-1306


Name           Line       Command

               Number
----------     ------
------------------------------------------------------------
------------------------------------------------------------
DAILY_MAI-     1          expi i quiet=y
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'
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
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
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

               101        exit

               106        retry:

               111        del sch daily_maint3 t=a

               116        def 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 */
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

               40         upd stg copy_directories reclaim=67


Name           Line       Command

               Number
----------     ------
------------------------------------------------------------
------------------------------------------------------------
ENDRECLAIM     10         upd stgp tapepool reclaim=100
ENDRECLAIM     10         upd stgp tapepool reclaim=100

               20         upd stgp copyvault reclaim=100

               30         run reclaimcount

               40         upd stg copy_directories reclaim=100


Name           Line       Command

               Number
----------     ------
------------------------------------------------------------
------------------------------------------------------------
RECLAIMCO-     10         select count(volume_name) as vaults from volumes
RECLAIMCO-     10         select count(volume_name) as vaults from volumes
where
 UNT                       pct_reclaim>=67 and stgpool_name='COPYVAULT'

               20         select count(volume_name) as carts from volumes
where
                           pct_reclaim>=67 and stgpool_name='TAPEPOOL'

               30         select count(volume_name) as copydirs from volumes
where
                           pct_reclaim>=67 and
stgpool_name='COPY_DIRECTORIES'

Name           Line       Command

               Number
----------     ------
------------------------------------------------------------
------------------------------------------------------------
EMPTYVAUL-     1          upd vol * access=readwrite wherestatus=pending
EMPTYVAUL-     1          upd vol * access=readwrite wherestatus=pending

 TRETURN                   wherestgpool=copyvault whereaccess=offsite

               5          upd vol * access=readwrite wherestatus=empty

                           wherestgpool=copyvault whereaccess=offsite


ANR1462I RUN: Command script LIST_MAINT completed successfully.
<Prev in Thread] Current Thread [Next in Thread>