$! $! EVERYNITE.JOB $! $! This batch job is run every night at midnight. It's purpose $! is to submit other batch jobs which run every day at various $! times. $! $ verify_mode = 'F$VERIFY(0)' $ GOTO L1$ $!+ EVERYNITE $! Items to be handled on a daily basis are done by the EVRYNITE job. $! This batch job uses the command procedure EVERYNITE.JOB to perform the $! housekeeping chores of setting and re-submitting the daily job. The $! actual work is done in the EVERYNITE.COM command procedure (to allow $! changes without having to resubmit the batch job). The batch job is $! invoked by: $! $! @SYS$MGR_UTIL:EVERYNITE.JOB opcode $! $! or by: $! $! SUBMIT/NOPRINT/NAME=EVRYNITE/PARAMETER=opcode - $! SYS$MGR_UTIL:EVERYNITE.JOB $! $!2 Opcode $! The operation code passed as the first parameter to the EVERYNITE.JOB $! command procedure determines the action this command procedure takes: $! $! SETUP setup the EVRYNITE batch job (also deletes any such $! jobs currently in the batch queue). Does not execute $! EVERYNITE.COM. $! $! ONCEONLY run once (with no re-submittal) usually for a test. $! $! GOGOGO normal operation, re-submit to run next month and then $! execute EVERYNITE.COM. $!- $! $! Created: 4-Sep-81 Frank J. Nagy Fermilab Accelerator/Controls $! $! Modifications: $! 11-Sep-81 FJN Added submittal of MADDELET job $! 18-Sep-81 FJN Resubmit self at priority 5 $! 18-Mar-82 FJN Removed actual commands done to EVERYNITE.COM to allow $! for easier changes $! 19-Aug-82 FJN Prepared for usage with VMS V3 $! 30-Aug-82 FJN Use VMS V3 features $! 06-Oct-82 FJN Raised batch priority $!============================================================================= $L1$: $! $ SET NOON $! $! Test for SETUP run (called as a command procedure) $! or for a ONCEONLY run (no re-submission) $! or for a normal (GOGOGO) midnight run $! - all by looking at parameter P1 $! $ IF p1 .EQS. "ONCEONLY" THEN GOTO DO_MY_THING $ IF p1 .NES. "GOGOGO" THEN GOTO FIRST_TIME_THRU $! $ PURGE EVRYNITE.LOG !Purge old versions of log file $! $! Re-submit to run at midnight (i.e. 00:00:00 hours tomorrow!) $! $ SUBMIT/AFTER=TOMORROW/NAME=EVRYNITE/PARAMETERS=GOGOGO/PRIORITY=28/NOPRINT - SYS$MGR_UTIL:EVERYNITE.JOB $ SHOW QUEUE/ALL SYS$BATCH $! $DO_MY_THING: $! $ GOTO L10$ $! Here is where the real work gets done. The SUBMIT commands (or @name) $! commands should go in the SYS$MGR_UTIL:EVERYNITE.COM file. Remember $! that this job is running under the SYSTEM account (UIC [1,4]) as will any $! batch jobs SUBMIT'ed from here or any command files executed from here. $! The current default directory is now: SYS$MANAGER:!! $! If a batch job must be run under a different user either you can: $! 1. Change the UIC and default directory at the start of the $! command file submitted as a batch job. $! 2. SPAWN a command file off under a different UIC to do you thing $! or SUBMIT a batch job. (Or you can insert a detached process $! RUN command into here). $! Note that the .LOG files for batch jobs submitted from here or detached $! processes SPAWN'ed from here are placed in SYS$MANAGER:. $! $! Changes to command files referenced in here may be made freely. If this $! command file is changed, you must be the SYSTEM user and the very next $! thing you must do is to do a setup run as in "@EVERYNITE.JOB SETUP" to $! delete any current EVRYNITE batch job(s) are re-submit so that the new $! version of the command file will be used. This job will also be $! re-submitted after the VAX is rebooted. $! $L10$: $! $ IF VERIFY_MODE THEN SET VERIFY $! ===================== $@SYS$MGR_UTIL:EVERYNITE.COM $! ===================== $ EXIT ! End-of-job for tonight $! $! For first time do: @EVERYNITE.JOB SETUP $! $FIRST_TIME_THRU: $! $! Delete any current EVRYNITE jobs in the queue $! $@SYS$MGR_UTIL:BATQUEDEL EVRYNITE $! $! Now submit job to run TOMORROW! $! $ SUBMIT/AFTER=TOMORROW/NAME=EVRYNITE/PARAMETERS=GOGOGO/PRIORITY=28/NOPRINT - SYS$MGR_UTIL:EVERYNITE.JOB $ SHOW QUEUE/ALL SYS$BATCH $ EXIT