| $! file : X_CONSOLE_EXTRACT.COM
$
$! This batch file will extract consoles data backing of the
$! various console data file into the history_area.
$! It will run in the morning, around 1am, and extract out the previous days
$! history.
$! it will resubmit itself to start again the next day.
$
$ on error then goto FAILURE
$!
$!
$ notify_list = "<person you want to notify>"
$ history_area = "Console$History"
$ sysname = ''p1'
$ com_filename = ''p2'
$ if p1 .eqs. "" then goto check_bad
$ if p2 .nes. "" then goto start_this
$ check_bad:
$ fil_err_on = "''sysname' - ''com_filename'"
$ goto much_bad
$!
$!
$ start_this:
$ if p3 .eqs. "" then p3 = "01:00:00"
$ if f$mode() .eqs "INTERACTIVE" then goto next_night
$ !
$ ! Formatted date information
$ !
$ set proc/priv=all
$ today = f$cvtime("TODAY","ABSOLUTE","DATE")
$ today_1 = f$cvtime("TODAY-1-00","ABSOLUTE","DATE")
$ today_2 = f$cvtime("TODAY-2-00","ABSOLUTE","DATE")
$ today_3 = f$cvtime("TODAY-3-00","ABSOLUTE","DATE")
$ today_4 = f$cvtime("TODAY-4-00","ABSOLUTE","DATE")
$ today_5 = f$cvtime("TODAY-5-00","ABSOLUTE","DATE")
$ yesterday = f$cvtime("YESTERDAY","ABSOLUTE","DATE")
$ yesterday_1 = f$cvtime("YESTERDAY-1-00","ABSOLUTE","DATE")
$ yesterday_2 = f$cvtime("YESTERDAY-2-00","ABSOLUTE","DATE")
$ yesterday_3 = f$cvtime("YESTERDAY-3-00","ABSOLUTE","DATE")
$ yesterday_4 = f$cvtime("YESTERDAY-4-00","ABSOLUTE","DATE")
$ yesterday_5 = f$cvtime("YESTERDAY-5-00","ABSOLUTE","DATE")
$!
$!
$!
$ ystdy = ''yesterday_5'
$ tdy = ''today_5'
$ fil_err_on = "''sysname'.''ystdy'"
$!
$ direct/date 'history_area':'sysname'.'ystdy'
$ if '$status' .eqs. %x00000001 then goto next5
$!
$ set verify
$ console extract /since='ystdy'/before='tdy'/time 'sysname' -
/out='history_area':'sysname'.'ystdy'
$ set noverify
$ next5:
$!
$!
$!
$ ystdy = ''yesterday_4'
$ tdy = ''today_4'
$ fil_err_on = "''sysname'.''ystdy'"
$!
$ direct/date 'history_area':'sysname'.'ystdy'
$ if '$status' .eqs. %x00000001 then goto next4
$!
$ set verify
$ console extract /since='ystdy'/before='tdy'/time 'sysname' -
/out='history_area':'sysname'.'ystdy'
$ set noverify
$ next4:
$!
$!
$!
$ ystdy = ''yesterday_3'
$ tdy = ''today_3'
$ fil_err_on = "''sysname'.''ystdy'"
$!
$ direct/date 'history_area':'sysname'.'ystdy'
$ if '$status' .eqs. %x00000001 then goto next3
$!
$ set verify
$ console extract /since='ystdy'/before='tdy'/time 'sysname' -
/out='history_area':'sysname'.'ystdy'
$ set noverify
$ next3:
$!
$!
$!
$ ystdy = ''yesterday_2'
$ tdy = ''today_2'
$ fil_err_on = "''sysname'.''ystdy'"
$!
$ direct/date 'history_area':'sysname'.'ystdy'
$ if '$status' .eqs. %x00000001 then goto next2
$!
$ set verify
$ console extract /since='ystdy'/before='tdy'/time 'sysname' -
/out='history_area':'sysname'.'ystdy'
$ set noverify
$ next2:
$!
$!
$!
$ ystdy = ''yesterday_1'
$ tdy = ''today_1'
$ fil_err_on = "''sysname'.''ystdy'"
$!
$ direct/date 'history_area':'sysname'.'ystdy'
$ if '$status' .eqs. %x00000001 then goto next1
$!
$ set verify
$ console extract /since='ystdy'/before='tdy'/time 'sysname' -
/out='history_area':'sysname'.'ystdy'
$ set noverify
$ next1:
$!
$!
$!
$ ystdy = ''yesterday'
$ tdy = ''today'
$ fil_err_on = "''sysname'.''ystdy'"
$!
$ direct/date 'history_area':'sysname'.'ystdy'
$ if '$status' .eqs. %x00000001 then goto next
$!
$ set verify
$ console extract /since='ystdy'/before='tdy'/time 'sysname' -
/out='history_area':'sysname'.'ystdy'
$ set noverify
$ next:
$!
$! Archive if any files are here then skip it all...
$!
$!
$ direct/date Console$archive:'sysname'.*
$ if '$status' .eqs. %x00000001 then goto archive_problems
$!
$!
$ fil_err_on = "''sysname'.archiv-''yesterday'"
$ set verify
$ console dialog/file=unlock.txt 'sysname'
$ console archive 'sysname'/before='yesterday'
$ set noverify
$!
$!
$! If we got here thn the archive must have been successfull
$! so delete the console$archive: area.
$ fil_err_on = "deleting console$archive: ''sysname' directory"
$ delete console$archive:'sysname'.*;*
$!
$!
$ mail /noself/sub="CONSOLE_EXTRACT SUCCESS - ''sysname'" -
nl: 'notify_list'
$!
$ next_night:
$ submit /after="tom+''p3'" -
/queue=sys$batch/nonotify -
'com_filename'
$ goto finish
$!
$!
$!
$ archive_problems:
$ mail /noself-
/sub="CONSOLE_EXTRACT FAILURE - ARCHIVE directory not empty - ''sysname'" -
nl: 'notify_list'
$
$! goto next_night
$!
$!
$!
$ much_bad:
$ mail /noself/sub="CONSOLE_EXTRACT FATAL - ''fil_err_on'" -
nl: 'notify_list'
$ goto finish
$!
$!
$!
$ FAILURE:
$ mail /noself/sub="CONSOLE_EXTRACT FAILURE - ''fil_err_on'" -
nl: 'notify_list'
$!
$!
$!
$ re_submit:
$ submit /after="+00:15" -
/queue=sys$batch/nonotify -
'com_filename'
$ finish:
$ exit
|
| $! file : CONSOLE_EXTRACT_PIZZA.COM
$!
$! This batch file will call X_CONSOLE_EXTRACT.COM which will
$! extract consoles data backing of the
$! various console data file into history_area.
$! It will run in the morning, around 1am, and extract out the previous days
$! history.
$! it will resubmit itself to start again the next day.
$!
$!
$ @x_console_extract.com pizza console_extract_pizza.com 00:35:00
$ exit
|