Subject: | |
From: | |
Reply To: | |
Date: | Mon, 29 Nov 1999 12:24:12 +0100 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
Here's a job that schedules itself .
It was basically built for running the backups every night and then other
bits were added on.
The job is called JBACKUP.STREAM.
The backup itself lasts 3 hours so - as it alwayas starts at 23:00 - it
always finished the NEXT DAY.
There are three neat things in it.
1. It re-streams itself. (Stream JBACKUP.STREAM ... AT parm)
2. It re-streams itself on Monday if it finishes on a Saturday.
(Stream JBACKUP.STREAM .... DAY parm)
3. The!PAUSE JOB=!HPLASTJOB;EXIST allows jobs to work one at a time.
!JOB BACKUP,MANAGER.SYS/PASSWORD;OUTCLASS=LP,1
!
Snipped ( Bring down network services ..)
!COMMENT Backup total
!FILE T;DEV=7
!STORE @[log in to unmask]@;*T;DIRECTORY;SHOW
!
Snipped ( Call up network services ..)..
!
!COMMENT Now that the Backup is finished , is this Saturday (morning) ? ....
!IF HPDAY = 7 THEN
!COMMENT Restream this job for Monday at 23:00
!COMMENT Then Stream the Everyday of the week jobs
!COMMENT and Finally stream the Weekend Jobs
!
!STREAM JBACKUP.STREAM.ACCOUNTX;DAY=MON;AT=23:00
!STREAM JWEEKDAY.STREAM.ACCOUNTX
!PAUSE JOB=!HPLASTJOB;EXIST
!Comment That last line is interesting because it allows the
!Comment JWEEKDAY job to finish before starting the next job (JWEEKEND)
! STREAM JWEEKEND.STREAM.ACCOUNTX
!COMMENT
!COMMENT But if this is NOT Saturday morning
!ELSE
!COMMENT Just Stream this job for tonight at 23:00
COMMENT Then stream the Everyday jobs
! STREAM JBACKUP.STREAM.ACCOUNTX;AT=23:00
! STREAM JWEEKDAY.STREAM.ACCOUNTX
!ENDIF
!EOJ
This main JBACKUP job hardly ever gets modified.
I just change entries in the JWEEKDAY and JWEEKEND stream files.
Here's an example chunk from JWEEKDAY ...
!JOB JWEEKDAY,MGR.ACCOUNT;outclass=LP,1
!
!COMMENT Controle
!STREAM JCONTROL.TOOLS.ACCOUNTX
!PAUSE JOB=!HPLASTJOB;EXIST
!
!COMMENT Mail Stats for Excel
!STREAM JSTATSMA.MAILSTAT.ACCOUNTX
!PAUSE JOB=!HPLASTJOB;EXIST
!
etc ..
The one thing JBACKUP doesn't handle is holidays.
But I'm sure someone could add on a bit where it could jump certain dates
that it reads from an input file.
Let me know if you find it useful.
Any compliments must go to la très charmante Blandine Lefebure.
Seamus Browne
Services Informatiques
Partage
|
|
|