ADSM-L

The joys of Adsm.pm and Perl

1997-07-07 16:44:36
Subject: The joys of Adsm.pm and Perl
From: Peter Thomas <Peter_Thomas AT MANULIFE DOT COM>
Date: Mon, 7 Jul 1997 16:44:36 -0400
From: Peter Thomas on 07/07/97 04:44 PM

Many thanks to Owen Crow for making his Adsm / Perl interface available.

With it, I've been able to create a few fairly simple Perl scripts to
automate the running of my overnight ADSM processing; now I come into work
in the morning, and have sitting in my eMail a report on how things worked.

The "controlling" job is a simple Shell script

## MLIdaily
##   Daily ADSN processing
##   Ensures that all data is copied from the disk to onsite storage pools,
##   and from the onsite to offsite storage pools.
##   Upon completion, send a copy of the output to someone..
##
## Variables:
##   to   Name of person (or Notes mailling list) to receive output of all
ADSM commands
##   rundate      Rundate in form ddmmyy. Used to create a unique log file
name
##   longdate   Rundate in Dayofweek Month Day, Year form. Used for human
readable subject
##   runtime      Time that the next job execution should be scheduled. This
should be the same
##             value as the start time of the scheduled ADSM backup events.
to="peter_thomas AT manulife DOT com"
rundate=`date +%d%m%y`
longdate=`date +"%A %B %e, %Y"`
runtime="23:00"

##
echo ADSM Daily processing: Run Date `date` > log.$rundate

## Wait for all events to end
## This will normally be between 11:00 pm and 3:00 am
echo `date`  Checking Events >> log.$rundate
./MLIcheck_events >> log.$rundate

## Upon end of all backups, force the DISK pool to spill to tape
echo `date`  Emptying Storage Pools >> log.$rundate
./MLIempty_pools >> log.$rundate

## Once all data is on tape, create the offsite copy
echo `date`  Backing up Storage Pools >> log.$rundate
./MLIbackup_stg >> log.$rundate

## At end, query the ADSM log for all messgaes from the start of processing
 till now
echo `date`  Activity log from start of Backup Windows to present time >>
log.$rundate
./sdsm q act begind=-1 begint=$runtime >> log.$rundate

## Schedule the next run of the daily ADSM process
echo `date`  Scheduling next job >> log.$rundate
echo "./MLIdaily" | at $runtime >> log.$rundate 2>&1

## Mail the log file to the correct person
mail -s "ADSM Daily Processing: $longdate" $to < log.$rundate

The various scripts (MLIcheck_events, MLIempty_pools and MLIbackup_stg)
were based on Owen's original scripts and do the following functions:

MLIcheck_events Checks every 5 minutes to see if all scheduled backups have
completed
MLIempty_pools  Ensures that the Disk storage pool is emptied to a colocated
tape pool
MLIbackup_stg    Backups the colocated tape pool to a non-colocated pool that
gets sent off site the next day

I receive in my eMail a report like this

ADSM Daily processing: Run Date Sat Jul 5 23:00:00 EDT 1997
Sat Jul 5 23:00:00 EDT 1997 Checking Events
Sat Jul  5 23:00:01 1997 16 Tasks still waiting to be completed
Sat Jul  5 23:05:01 1997 16 Tasks still waiting to be completed
     ...
Sun Jul  6 03:00:33 1997 0 Tasks still waiting to be completed
Sun Jul  6 03:00:33 1997 Following events have been skipped
07/05/97   23:00:00                       DAILY         ENTSLAB2
Missed
07/05/97   23:00:00                       DAILY         MLISWATDNS
Missed
07/05/97   23:00:00                       DAILY         N06TEMP
Missed
07/05/97   23:00:00                       DAILY         TORSNOTES4
Missed
Sun Jul  6 03:00:33 1997 All events completed!
Sun Jul 6 03:00:33 EDT 1997 Emptying Storage Pools
Sun Jul  6 03:00:33 1997 Getting current high migration level for
MLI_TOR_BACKUP
Sun Jul  6 03:00:33 1997 Setting migration level on MLI_TOR_BACKUP to 0%
Sun Jul  6 03:05:34 1997 Resetting migration level on MLI_TOR_BACKUP to 75%
Sun Jul  6 03:05:34 1997 Waiting for migration to finish...
Sun Jul  6 03:10:34 1997 Percent migratable left: 0.0
Sun Jul  6 03:10:34 1997 Migration finished.
Migration finished.  There may have been errors during
either operation which this script can not capture.  Please use "query
actlog" to check for errors then procede to the offsiting script.
Sun Jul 6 03:10:34 EDT 1997 Backing up Storage Pools
Sun Jul  6 03:10:34 1997 Starting backup of MLI_TOR_BKP_ONSITE to
MLI_TOR_BKP_OFFSITE.
Sun Jul  6 03:10:35 1997 Waiting for backup process number 354 to end
Sun Jul  6 03:10:35 1997 Bytes backed up so far: 0
Sun Jul  6 03:15:35 1997 Bytes backed up so far: 240,960
Sun Jul  6 03:20:35 1997 Bytes backed up so far: 640,636,170
     ...
Sun Jul  6 05:30:39 1997 Bytes backed up so far: 16,246,195,675
Sun Jul  6 05:35:39 1997 Bytes backed up so far: 17,024,256,310
Sun Jul  6 05:40:39 1997 Backup StgPool completed
Stgpool copy finished.  There may have been errors during
either operation which this script can not capture.  Please use "query
actlog" to check for errors
Sun Jul 6 05:40:39 EDT 1997 Activity log from start of Backup Windows to
present time

Date/Time            Message
-------------------- ------------------------------------------------------
----
----
07/05/97   23:00:00  ANR0402I Session 8594 started for administrator ADMIN
07/05/97   23:00:00  ANR0402I Session 8594 started for administrator ADMIN
                      (AIX).
07/05/97   23:00:01  ANR0405I Session 8594 ended for administrator ADMIN
(AIX).
     ...
                      07/06/97   05:37:24  ANR1212I Backup process 354
ended for storage pool
                      MLI_TOR_BKP_ONSITE.
07/06/97   05:37:35  ANR1214I Backup of primary storage pool
MLI_TOR_BKP_ONSITE
                      to copy storage pool MLI_TOR_BKP_OFFSITE has ended.
                      Files Backed Up: 4492, Bytes Backed Up: 17338689372,
                      Unreadable Files: 0, Unreadable Bytes: 0.
07/06/97   05:40:39  ANR0402I Session 8751 started for administrator ADMIN
                      (AIX).
07/06/97   05:40:39  ANR0405I Session 8751 ended for administrator ADMIN
(AIX).
07/06/97   05:40:39  ANR0402I Session 8752 started for administrator ADMIN
                      (AIX).

Sun Jul 6 05:40:40 EDT 1997 Scheduling next job
Job thomape.868244400.a will be run at Sun Jul  6 23:00:00 EDT 1997.

Does this ever make life simpler!

Peter Thomas
Manulife Financial
<Prev in Thread] Current Thread [Next in Thread>
  • The joys of Adsm.pm and Perl, Peter Thomas <=