Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!lll-crg!mordor!sri-spam!nike!ucbcad!ucbvax!rtpark.RTP.GE.COM!rlb From: rlb@rtpark.RTP.GE.COM Newsgroups: mod.computers.vax Subject: (none) Message-ID: <8609060311.AA01674@ge-rtp.GE.COM> Date: Fri, 5-Sep-86 23:11:10 EDT Article-I.D.: ge-rtp.8609060311.AA01674 Posted: Fri Sep 5 23:11:10 1986 Date-Received: Sat, 6-Sep-86 22:01:33 EDT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The ARPA Internet Lines: 124 Approved: info-vax@sri-kl.arpa From: mcnc!rtpark.rtp.ge.com!rlb@seismo.CSS.GOV (Bob Boyd,8*274-3627) To: "info-vax@sri-kl.arpa"@ge-rtp.ge.com Subject: RE: Cluster clock synchronizing, Midnight jo{ $ ! newdayque.com -- setup new que jobs and other daily jobs $ ! invoked from quecom:newday.com -- this way the submitted one $ ! doesn't have to be changed. Just this one which is invoked. $ ! This way any updates take effect the next morning instead of $ ! morning after next. $ ! at midnight each night $ vfl=f$verify(1) $ set noon $! set up lots of symbols for later reference $ cvttime = "$util_root:[fermilab]time" ! set up time calculator $ @utl:getnode $ @utl:setnode ! this sets up symbols if_ and if_not_ for $! all nodes in our cluster/local net $ save_dir = f$parse("")-".;" $! $! $ yymmdd = "" $ xtime = f$cvtime(f$time()) $ yymmdd = node_pref+f$ext(2,2,xtime)+f$ext(5,2,xtime)+f$ext(8,2,xtime) $! $! start a new log file for today $! $ @quecom:operlog $! Start a new DECnet event log file for the new day $ @quecom:netlog $! $ set def quecom: $!---------------------------------------------------------- $!see if we are really running in a "tommorrow" environment $! if not, wait until 1 minute after midnight to resume. $! $! first -- synchronize clock with master node -- currently vv1 $! This is necessary because there is no VMS cluster clock $! synchronization implemented yet. This goody does it on $! a once a day basis. If the clocks are off, log in on $! the master node and do @SYS$MANAGER:TIMESET $! $ clock_master = "VN1" $ clock_synch = if_not_'clock_master' $'clock_synch' @sys$Manager:timeset $! $! now let's see if we're past midnight yet $! (keep in mind we may have just set back before midnight with synchronize) $! $SYNCH_CHECK: $ lastminutes = f$cvtime("today+23:30:0.0") $ lastminutes_a = f$cvtime("today+23:00:0.0","absolute") $ last_hours = f$cvtime("today+0-14:00") $ tomorrow = f$cvtime("tomorrow") $ tomorrow_a = f$cvtime("tomorrow","absolute") $ now = f$cvtime() $ now_a = f$cvtime("","absolute") $ show sym now $ show sym tomorrow $! if this falls in the window of afternoon but not late night then $! resubmit and skip to the beginning of next day -- after 2:00 you $! probably can't get everything done anyway (? -- depends on what) $ if now.gts.last_hours .and. now.lts.lastminutes then $ goto RESUBMIT $! if we have not quite made it then skip synch wait $ if now.lts.lastminutes .or. now.ges.tomorrow then $ goto SYNCH_SKIP $ cvttime/sym=wait_delta 'TOMORROW_A'(-)'NOW_A'(+)0-0:1:0 $ request "SUSPENDING NEWDAY JOB for ''wait_delta' time (due to clock changes)" $ wait 'wait_delta' $ goto SYNCH_CHECK $RESUBMIT: $ subsys/log_file=quecom:'node'_newday.log/noprinter - /name='node'_newday - quecom:newday.com/priority=31/after=tomorrow/restart ! tomorrow's job $ exit $!---------------------------------------------------------- $SYNCH_SKIP: $! ok -- now that that's all cleared up, let's get on with the other stuff. $ $! $! ... $! all the stuff you want to get scheduled $! $! like the following for a daily backup job $ inc_time = "5:30" $'if_backup_node' goto submit_backup $'if_not_backup_node' goto skip_backup $submit_backup: $ sub/queue=sys$sysbatch/after='inc_time'- /cpu=infinite/restart/name=backup_'yymmdd' - /log=backups:'yymmdd'.log/notify/noprint - /parameter=("",'yymmdd',"","",2) - backups:new_everyday $! params p1 = ?, p2 = job prefix, p3 = ?, p4 = ?, p5 = max # of drives to use. $ subsys/after=9:00/cpu=0:10:0/param=('yymmdd') - backups:errsum/name=backerr_'yymmdd'/restart- /log=backups:'yymmdd'_err.log/notify/noprint $ delete/created/before="TODAY-20-0:" backups:'node_pref'*.log;*/log $SKIP_BACKUP: $ if daynum.eq.0 then $ - subsys sys$com:weekly- /noprint/log=quecom:'node'_weekly- /priority=5/after=7:05:00.00 $ @UTL:fiscalwk $ fiscal_week = fiscal_week-1 $ node = f$trnlnm("sys$node")-"_"-":"-":" $ fiscal_week = f$fao("!2ZL",fiscal_week) $!------------------------------------------------------------------------ $DONE: $ @quecom:update_temacs $! reset imagen $'if_vv1' stop/que/next imagen $'if_vv1' wait 0:0:10 $'if_vv1' start/que imagen $ $'if_vv1' @phone_dir:getphone ! see if we need a fresh copy of phone_dir file $'if_vv1' @uafcom:dcs_rights ! update the DCS Rights holders if needed $'if_vv1' purge/log/keep=6 quecom:*newday.log,*mornque.log,*niteque.log,*noon.log $ set proc/priv=bypass $'if_not_VS4' 'if_not_vv1' goto exit $'if_vs4' if f$getsyi("vv1","cluster_member") then $ goto exit $ @uafcom:secure_update $exit: $ set def 'save_dir' $ vfl = f$verify(vfl) $ exit