[news.software.anu-news] QUEUE checking for hourly SKIM

ross@mscf.med.upenn.edu (07/14/89)

	We ran into the following problem yesterday.  We have a batch job
called HOURLY.COM which runs every hour to SKIM.  The first line of 
HOURLY.COM is a SUBMIT commmand to resubmit HOURLY at time+1 hr.  The problem
occured when the server that we access went down and the first hourly job was
not completed when the second one started running.  Then in a short time we
had 3 of these hourly jobs running at once.
	Does anybody know an easy way to modify the com file so that it can
dectect if another HOURLY job is still executing and if so, how to resubmit
the next job for a later time?
-- 

			--- Andy Ross ---
                    University of Pennsylvania
		 Medical School Computer Facility

SYSNET@cc.nu.oz (David Morrison - Network Manager) (07/17/89)

In article <34@mscf.med.upenn.edu>, ross@mscf.med.upenn.edu writes:
> 	We ran into the following problem yesterday.  We have a batch job
> called HOURLY.COM which runs every hour to SKIM.  The first line of 
> HOURLY.COM is a SUBMIT commmand to resubmit HOURLY at time+1 hr.  The problem
> occured when the server that we access went down and the first hourly job was
> not completed when the second one started running.  Then in a short time we
> had 3 of these hourly jobs running at once.
> 	Does anybody know an easy way to modify the com file so that it can
> dectect if another HOURLY job is still executing and if so, how to resubmit
> the next job for a later time?

Here is the result of my efforts to tidy up the NEWS batch scheme.  I too had
problems with multiple jobs at the same time, especially when the machine died 
overnight.  When restarted, all the pending jobs started again at the same 
time.  It is *NOT* a good thing to have a job SKIMming at the same time that 
another job is adding new news items!!!

This is written for our particular situation, ie, using Decnet copy and MAIL 
to distribute news.  Within that constraint, it is easily configurable for
other sites.  I will soon have to do a bit more work for other mechanisms.

If anyone makes any useful modifications, please let me know.
-- 
David Morrison, Network Manager, Uni of Newcastle, Australia
Try sysnet@cc.nu.oz.au or sysnet@cc.nu.oz  (mail only)
or (VAX PSI) psi%newcastle.edu.au::sysnet or psi%0505249626002::sysnet

$!...................... Cut on the dotted line and save ......................
$! VAX/VMS archive file created by VMS_SHAR V-5.04 04-Feb-1988
$! which was written by Michael Bednarek (U3369429@ucsvc.dn.mu.oz.au)
$! To unpack, simply save and execute (@) this file.
$!
$! This archive was created by SYSNET
$! on Thursday 13-JUL-1989 16:54:28.31
$!
$! It contains the following 4 files:
$! NEWSJOBS.DOC NEWSJOBS.COM NEWSSKIM.COM NEWSADD.COM
$!=============================================================================
$Set Symbol/Scope=(NoLocal,NoGlobal)
$Version=F$GetSYI("VERSION")
$If Version.ges."V4.4" then goto Version_OK
$Write SYS$Output "Sorry, you are running VMS ",Version, -
", but this procedure requires V4.4 or higher."
$Exit 44
$Version_OK:CR[0,8]=13
$Pass_or_Failed="failed!,passed."
$Goto Start
$Convert_File:
$Read/Time_Out=0/Error=No_Error1/Prompt="creating ''File_is'" SYS$Command ddd
$No_Error1:Define/User_Mode SYS$Output NL:
$Edit/TPU/NoSection/NoDisplay/Command=SYS$Input/Output='File_is' -
VMS_SHAR_DUMMY.DUMMY
f:=Get_Info(Command_Line,"File_Name");b:=Create_Buffer("",f);
o:=Get_Info(Command_Line,"Output_File");Set(Output_File,b,o);
Position(Beginning_of(b));Loop x:=Erase_Character(1);Loop ExitIf x<>"V";
Move_Vertical(1);x:=Erase_Character(1);Append_Line;
Move_Horizontal(-Current_Offset);EndLoop;Move_Vertical(1);
ExitIf Mark(None)=End_of(b) EndLoop;Position(Beginning_of(b));Loop
x:=Search("`",Forward,Exact);ExitIf x=0;Position(x);Erase_Character(1);
If Current_Character='`' then Move_Horizontal(1);else
Copy_Text(ASCII(INT(Erase_Character(3))));EndIf;EndLoop;Exit;
$Delete VMS_SHAR_DUMMY.DUMMY;*
$Checksum 'File_is
$Success=F$Element(Check_Sum_is.eq.CHECKSUM$CHECKSUM,",",Pass_or_Failed)+CR
$Read/Time_Out=0/Error=No_Error2/Prompt=" CHECKSUM ''Success'" SYS$Command ddd
$No_Error2:Return
$Start:
$File_is="NEWSJOBS.DOC"
$Check_Sum_is=2050251097
$Copy SYS$Input VMS_SHAR_DUMMY.DUMMY
X`009`009`009Distribution of News
X`009`009`009====================
X
XThis is an alternate way to set up news distribution when using the VMS NEWS
Xsystem by Geoff Huston.  It should be read in conjunction with section 9.7 of
Xthe NEWS V5.4 documentation.  Basically, it uses similar mechanisms to the
Xoriginal, but tidies up some loose ends.  For example, it can deal with news
Xcaught in system crashes, prevent two jobs adding news at the same time,
Xprocess news partly-processed by mail.
X
X
XAssumptions
X-----------
XThe news node name is the same as the network node name.  That is, if the news
Xnode name is CC, then CC:: is the Decnet node name.
X
XProxies are enabled for Decnet machines.
X
XPMDF is used for mailing news batches, and all machines being forwarded to can
Xbe reached by sending to IN%"rnews@node".  This may require an explicit entry
Xin the PMDF configuration file if the node is not in the same subdomain.
X
X
XDecnet Nodes
X------------
VOn each node, directories are set up for each node to which news is distribute
Xd,
Xas determined by entries in NEWS.SYS.  These directories will be
X
X`009NEWS_MANAGER_DEV:[POSTD_othernode]
X
Xand it is assumed that a directory exists on that machine corresponding to the
Xlocal node, ie,
X
X`009othernode::NEWS_MANAGER_DEV:[POSTD_localnode]
X
XOn each node, items to be distributed will be appended to NEWS.BATCH in the
Xrelevent directory.  On a regular basis, each node will poll the others to see
Xif there is any news for it.  If so, the file(s) will be copied and deleted.
X
XThe entry in NEWS.SYS for such a node should be something like:
X
X`009othernode:comp,sci,news:NEWS_MANAGER_DEV/[POSTD_othernode]NEWS.BATCH^B
X
X
XUnix or Non-Decnet Nodes
X------------------------
VThese nodes are not able to use Decnet to transfer files, so news is distribut
Xed
Vusing a mail system.  The structure is basically similar to the Decnet one, ie
X,
Xitems to be forwarded to a node are appended to NEWS.BATCH in
X
X`009NEWS_MANAGER_DEV:[POSTM_othernode]
X
XOn a regular basis, these files will be mailed to the news receiver on the
Xother machine.  For VMS News, this should be USENET, and for Unix should be
Xrnews.  Alternatively, set up a mail alias for the one of your choice on the
Xtarget machine, and modify the relevent line in NEWSADD.COM.
X
XThe entry in NEWS.SYS for such a node should be something like:
X
X`009othernode:comp,sci,news:NEWS_MANAGER_DEV/[POSTM_othernode]NEWS.BATCH^B
X
Xor for some Unix machines:
X
X`009othernode:comp,sci,news:NEWS_MANAGER_DEV/[POSTM_othernode]NEWS.BATCH^BN
X
X
XFiles in this distribution:
X--------------------------
XNEWSSKIM.COM`009Does a skim of the news system, usually once per day.
X
XNEWSADD.COM`009Processes incoming news and mails outgoing news, several times
X`009`009per day.
X
XNEWSJOBS.COM`009A command file which submits NEWSSKIM for 2:30 am, and NEWSADD
X`009`009for two hour intervals during the day.  This would be executed
X`009`009by a job that runs shortly after midnight each day.  Edit the
X`009`009file to set the batch queue and usernames that the jobs are to
X`009`009run under.  There are two symbols here which should be defined 
X`009`009for your site.  See the comments in the file.
X
XNEWSJOBS.DOC`009This documentation file.
X
X
XDavid Morrison
XUniversity of Newcastle
XAustralia
Xpostmaster@cc.nu.oz.au
X16-Mar-89
$GoSub Convert_File
$File_is="NEWSJOBS.COM"
$Check_Sum_is=1127290594
$Copy SYS$Input VMS_SHAR_DUMMY.DUMMY
X$!`009`009NEWSJOBS.COM
X$!
X$!`009Submit regular news jobs
X$!
X$!`0098-Sep-88`009David Morrison, Uni of Newcastle
X$!
X$`009set noon
X$!*** Set the following to the batch queue you intend to use
X$`009batchqueue = "SYS_NET"
X$!*** Set the following to the username you want to run the jobs under
X$!    This is in case NEWSJOBS is executed from another username to that
X$!    which the jobs are to run under.
X$`009username = "NETNEWS"
X$!
X$! This is used to return a composite status value.
X$`009status = 1`009`009! Assume success
X$!
X$!`009Submit the skim job - once a day is enough
X$!
X$`009submit/queue='batchqueue'-
X`009`009/user='username'-
X`009`009/after="today+2:30"-
X`009`009/log=news_manager:-
X`009`009/noprint-
X`009`009`009news_manager:newsskim.com
X$`009status = status .and. $status
X$!
X$!`009Submit the add jobs
X$!
X$`009submit/queue='batchqueue'-
X`009`009/user='username'-
X`009`009/after="today+5:30"-
X`009`009/log=news_manager:-
X`009`009/noprint-
X`009`009`009news_manager:newsadd.com
X$`009status = status .and. $status
X$`009submit/queue='batchqueue'-
X`009`009/user='username'-
X`009`009/after="today+7:30"-
X`009`009/log=news_manager:-
X`009`009/noprint-
X`009`009`009news_manager:newsadd.com
X$`009status = status .and. $status
X$`009submit/queue='batchqueue'-
X`009`009/user='username'-
X`009`009/after="today+8:30"-
X`009`009/log=news_manager:-
X`009`009/noprint-
X`009`009`009news_manager:newsadd.com
X$`009status = status .and. $status
X$`009submit/queue='batchqueue'-
X`009`009/user='username'-
X`009`009/after="today+9:30"-
X`009`009/log=news_manager:-
X`009`009/noprint-
X`009`009`009news_manager:newsadd.com
X$`009status = status .and. $status
X$`009submit/queue='batchqueue'-
X`009`009/user='username'-
X`009`009/after="today+10:30"-
X`009`009/log=news_manager:-
X`009`009/noprint-
X`009`009`009news_manager:newsadd.com
X$`009status = status .and. $status
X$`009submit/queue='batchqueue'-
X`009`009/user='username'-
X`009`009/after="today+11:30"-
X`009`009/log=news_manager:-
X`009`009/noprint-
X`009`009`009news_manager:newsadd.com
X$`009status = status .and. $status
X$`009submit/queue='batchqueue'-
X`009`009/user='username'-
X`009`009/after="today+12:30"-
X`009`009/log=news_manager:-
X`009`009/noprint-
X`009`009`009news_manager:newsadd.com
X$`009status = status .and. $status
X$`009submit/queue='batchqueue'-
X`009`009/user='username'-
X`009`009/after="today+13:30"-
X`009`009/log=news_manager:-
X`009`009/noprint-
X`009`009`009news_manager:newsadd.com
X$`009status = status .and. $status
X$`009submit/queue='batchqueue'-
X`009`009/user='username'-
X`009`009/after="today+14:30"-
X`009`009/log=news_manager:-
X`009`009/noprint-
X`009`009`009news_manager:newsadd.com
X$`009status = status .and. $status
X$`009submit/queue='batchqueue'-
X`009`009/user='username'-
X`009`009/after="today+15:30"-
X`009`009/log=news_manager:-
X`009`009/noprint-
X`009`009`009news_manager:newsadd.com
X$`009status = status .and. $status
X$`009submit/queue='batchqueue'-
X`009`009/user='username'-
X`009`009/after="today+16:30"-
X`009`009/log=news_manager:-
X`009`009/noprint-
X`009`009`009news_manager:newsadd.com
X$`009status = status .and. $status
X$`009submit/queue='batchqueue'-
X`009`009/user='username'-
X`009`009/after="today+17:30"-
X`009`009/log=news_manager:-
X`009`009/noprint-
X`009`009`009news_manager:newsadd.com
X$`009status = status .and. $status
X$`009submit/queue='batchqueue'-
X`009`009/user='username'-
X`009`009/after="today+19:30"-
X`009`009/log=news_manager:-
X`009`009/noprint-
X`009`009`009news_manager:newsadd.com
X$`009status = status .and. $status
X$`009submit/queue='batchqueue'-
X`009`009/user='username'-
X`009`009/after="today+22:30"-
X`009`009/log=news_manager:-
X`009`009/noprint-
X`009`009`009news_manager:newsadd.com
X$`009status = status .and. $status
X$!
X$`009purge/keep=4 news_manager:newsskim.log
X$`009purge/keep=40 news_manager:newsadd.log
X$!`009`009(Need a lot in case of trouble.  Most will have "nothing" in
X$!`009`009them.)
X$!
X$`009exit status
$GoSub Convert_File
$File_is="NEWSSKIM.COM"
$Check_Sum_is=1598284395
$Copy SYS$Input VMS_SHAR_DUMMY.DUMMY
X$!`009`009NEWSSKIM.COM
X$!
X$! Checks news files for consistency, and scans all news items and deletes all
X$! items that have expired.  Also cleans up the file structures.
X$! Should be run once per day, about midnight.
X$!
X$!`0097-Sep-88`009David Morrison, Uni of Newcastle
X$!`00914-Dec-88`009Clear any lock file left over (and hope that no other
X$!`009`009`009job is still running)
X$!`00924-Feb-89`009Make the lock file more reliable
X$!`00915-Jun-89`009Change file names for NEWS V5.8A
X$!
X$`009set noon
X$`009show time
X$!`009Clean up the lock file first
X$`009lock_count = 0
X$check_lock:
X$`009create news_manager:news.lock;1
X$`009if $status then $ goto end_lock`009`009! No lock, so proceed
X$!`009There is a lock, so wait for a while to see if the other job finishes
X$`009wait 00:10:00
X$`009lock_count = lock_count+1
X$`009if lock_count .lt. 6 then $ goto check_lock
X$!`009Ignore the lock
X$`009mail/subject="NEWSSKIM: Lock file overridden at ''f$time()'" nl: usenet
V$`009create news_manager:news.lock;1`009`009! Just in case it has gone in the 
Xmeantime
X$end_lock:
X$!
X$`009news/noscreen
Xskim
Xexit
X$`009x = f$cvtime("TODAY",,"WEEKDAY")
X$`009if x .nes. "Sunday" then $ goto end_cleanup
X$`009`009convert news_root:news.groups news_root:news.groups
X$`009`009convert/reclaim news_root:news.groups
X$`009`009purge news_root:news.groups
X$`009`009convert news_root:news.items news_root:news.items
X$`009`009convert/reclaim news_root:news.items
X$`009`009purge news_root:news.items
X$end_cleanup:
X$`009delete news_manager:news.lock;1
X$`009exit
$GoSub Convert_File
$File_is="NEWSADD.COM"
$Check_Sum_is=1853764450
$Copy SYS$Input VMS_SHAR_DUMMY.DUMMY
X$!`009`009NEWSADD.COM
X$!
X$! Reads mailed news items and items from other Decnet nodes, and
X$! processes them into the news system.  Also sends items to other nodes where
X$! required.
X$! May be run several times each day to distribute news items as they arrive.
X$!
X$!`0098-Sep-88`009David Morrison, Uni of Newcastle
X$!`00914-Dec-88`009Add a lock file to prevent multiple jobs running at
X$!`009`009`009the same time.
X$!`00915-Feb-89`009Add /EXECUTE=LOCAL to ADD FILE commands so that new
X$!`009`009`009groups are created immediately and groups to be
X$!`009`009`009removed are made local instead.
X$!`00924-Feb-89`009Make the lock file more reliable
X$!`0093-Mar-89`009Remove /EXECUTE=LOCAL because of partial checkgroups
X$!`009`009`009messages (eg, bionet) stuffing everything up.
X$!`00916-Mar-89`009Deal with mail messages that end up in the MAIL folder
X$!`009`009`009not NEWMAIL.
X$!`0094-Jul-89`009Add /EXECUTE=LOCAL to ADD FILE again, since partial
X$!`009`009`009checkgroups are now processed properly.
X$!
X$`009set noon
X$`009localnode = f$trnlnm("NEWS_NODE")
X$!
X$!`009Set up lock file (If the file exists, another job is running, so
X$!`009abandon this one.  Otherwise, create the file to lock others out.)
X$!`009(Create gives an error if the file already exists.)
X$!
X$`009show time
V$`009wait 00:00:30`009`009! Give NEWSSKIM a chance to start if all begin at on
Xce
X$`009create news_manager:news.lock;1
X$`009if .not. $status then $ exit
X$!
X$!`009Process mailed news items
X$!`009=========================
X$!
X$! The following contorted mail commands are designed to make sure that any
X$! items that happen to get marked as read are processed, and in the correct
X$! order.  Error messages will almost always be generated, but can be ignored.
X$`009mail
Xset folder newmail
Xdir
Xfile/all mail
Xy
Xset folder mail
Xextract/all news_manager:news.mail
Xdelete/all
Xexit
X$mail_search:
V$`009if f$search("NEWS_MANAGER:NEWS.MAIL;") .eqs. "" then $ goto end_mail_item
Xs
X$!`009Add the oldest items first
X$!`009New groups created as commands arrive, groups to be deleted are made
X$!`009local instead of being deleted.
X$`009news/noscreen
Xadd file/execute=local/delete news_manager:news.mail;-0
Xexit
X$`009goto mail_search
X$end_mail_items:
X$!
X$!`009Copy items from other Decnet nodes and process them
X$!`009===================================================
X$!
X$decnet_search:
V$`009othernode = f$search("NEWS_MANAGER:POSTD_*.DIR",1)`009! Get any other nod
Xe names
X$`009if othernode .eqs. "" then goto end_decnet
X$`009othernode = f$parse(othernode,,,"NAME","SYNTAX_ONLY") - "POSTD_"
X$decnet_copy:
X$!`009Check to see if there is any waiting news
V$`009remote_file = f$search("''OTHERNODE'::NEWS_MANAGER_DEV:[POSTD_''LOCALNODE
X']NEWS.BATCH;-0")
V$`009if remote_file .eqs. "" then $ goto decnet_search`009! No waiting news, s
Xo go to next node
X$`009copy/log 'remote_file' news.batch;
X$`009if .not. $status then $ goto decnet_error`009! Error copying the file
X$`009delete/log 'remote_file'
X$!`009New groups created as commands arrive, groups to be deleted are made
X$!`009local instead of being deleted.
X$`009news/noscreen
Xadd file/execute=local/delete news.batch;
Xexit
X$`009goto decnet_copy`009`009! See if there are any more files
X$!
X$!`009Error in Decnet section
X$!
X$! File not copied properly.  Try next node after reporting it.
X$decnet_error:
X$`009mail/subject="Error in NEWSADD: Decnet section" nl: postmaster
X$`009goto decnet_search
X$end_decnet:
X$!
X$!`009Send items to nodes fed by mail
X$!`009===============================
X$!
X$mail_search:
V$`009othernode = f$search("NEWS_MANAGER:POSTM_*.DIR",1)`009! Get any other nod
Xe names
X$`009if othernode .eqs. "" then goto end_mail
X$`009othernode = f$parse(othernode,,,"NAME","SYNTAX_ONLY") - "POSTM_"
X$send_mail:
X$!`009Check to see if there is any waiting news
V$`009local_file = f$search("NEWS_MANAGER_DEV:[POSTM_''OTHERNODE']NEWS.BATCH;-0
X")
V$`009if local_file .eqs. "" then $ goto mail_search`009! No waiting news, so g
Xo to next node
X$!*** Replace "rnews" by another username if necessary.
V$`009mail/subject="News batch from ''localnode'" 'local_file' "in%""rnews@''ot
Xhernode'"""
X$`009if .not. $status then $ goto mail_error`009`009! Error mailing the file
X$`009delete/log 'local_file'
X$`009goto send_mail`009`009! See if there are any more files
X$!
X$!`009Error in mail section
X$!
X$! File not mailed properly.  Try next node after reporting it.
X$mail_error:
X$`009mail/subject="Error in NEWSADD: mail section" nl: postmaster
X$`009goto mail_search
X$end_mail:
X$!`009Clean up the lock file before we finish
V$`009if f$search("NEWS_MANAGER:NEWS.LOCK;") .nes. "" then $ delete news_manage
Xr:news.lock;*
X$`009exit
$GoSub Convert_File
$Exit

SLOANE@kuhub.cc.ukans.edu (Bob Sloane) (07/18/89)

> 	We ran into the following problem yesterday.  We have a batch job
> called HOURLY.COM which runs every hour to SKIM.  The first line of 
> HOURLY.COM is a SUBMIT commmand to resubmit HOURLY at time+1 hr.  The problem
> occured when the server that we access went down and the first hourly job was
> not completed when the second one started running.  Then in a short time we
> had 3 of these hourly jobs running at once.
> 	Does anybody know an easy way to modify the com file so that it can
> dectect if another HOURLY job is still executing and if so, how to resubmit
> the next job for a later time?

There are a couple of different ways you can synchronize these batch jobs. I
suspect the command you want to use is the SYNCHRONIZE DCL command.  You can
say "SYNC <job-name>/QUE=<que>" and the job issuing the SYNC command will wait
until the specified job is finished.  Another possibility is to do use the
"SET PROCESS/NAME=HOURLY_SKIM" command near the beginning of the batch file.
This command will die with a fatal error if there is another user in the same
group with a process name of HOURLY_SKIM, causing the job to delete.  I have
used this method occasionally, but I would recommend using the SYNC command
for what you want to do.
+-------------------+-------------------------------------+------------------+
|  Bob Sloane        \Internet: SLOANE@KUHUB.CC.UKANS.EDU/Anything I said is |
|  Computer Center    \ BITNET: SLOANE@UKANVAX.BITNET   / my opinion, not my |
|  University of Kansas\  AT&T: (913) 864-0444         /  employer's.        |
+-----------------------+-----------------------------+----------------------+

UNOCC07@UNOMA1.BITNET (Dave Caplinger) (07/18/89)

In article <2685@zeus.unl.edu>, ross@MSCF.MED.UPENN.EDU writes:
>         We ran into the following problem yesterday.  We have a batch job
> called HOURLY.COM which runs every hour to SKIM.  The first line of
> HOURLY.COM is a SUBMIT commmand to resubmit HOURLY at time+1 hr.  The problem
> occured when the server that we access went down and the first hourly job was
> not completed when the second one started running.  Then in a short time we
> had 3 of these hourly jobs running at once.
>         Does anybody know an easy way to modify the com file so that it can
> dectect if another HOURLY job is still executing and if so, how to resubmit
> the next job for a later time?
>
>                         --- Andy Ross ---
     
How about moving the SUBMIT command to the end of the HOURLY.COM?
     
-/ Dave Caplinger /------------------+-----------------------------------
 Microcomputer Specialist            |  Internet: unocc07@zeus.unl.edu
 "Computing and Data Communications" |  UUCP:     uunet!btni!unocss!dent
 University of Nebraska at Omaha     |  Bitnet:   UNOCC07@UNOMA1
 Omaha, NE 68182                     |    or      dc3a+@andrew.cmu.edu

SYSNET@cc.nu.oz (David Morrison - Network Manager) (07/19/89)

In article <5673@kuhub.cc.ukans.edu>, SLOANE@kuhub.cc.ukans.edu (Bob Sloane) writes:
> There are a couple of different ways you can synchronize these batch jobs. I
> suspect the command you want to use is the SYNCHRONIZE DCL command.  You can
> say "SYNC <job-name>/QUE=<que>" and the job issuing the SYNC command will wait
> until the specified job is finished.  Another possibility is to do use the

The drawback is that the second job just sits on the queue until the other
finishes.  If by chance you end up with several of these jobs running (after 
the machine has been down for several hours), you might find that your batch 
queue is full of jobs waiting for others to finish, and nothing else gets 
processed.

> "SET PROCESS/NAME=HOURLY_SKIM" command near the beginning of the batch file.
> This command will die with a fatal error if there is another user in the same
> group with a process name of HOURLY_SKIM, causing the job to delete.  I have
> used this method occasionally, but I would recommend using the SYNC command
> for what you want to do.

This method gets around the disadvantage above.
-- 
David Morrison, Network Manager, Uni of Newcastle, Australia
Try sysnet@cc.nu.oz.au or sysnet@cc.nu.oz  (mail only)
or (VAX PSI) psi%newcastle.edu.au::sysnet or psi%0505249626002::sysnet

SYSNET@cc.nu.oz (David Morrison - Network Manager) (07/19/89)

In article <2753@zeus.unl.edu>, UNOCC07@UNOMA1.BITNET (Dave Caplinger) writes:
>>         Does anybody know an easy way to modify the com file so that it can
>> dectect if another HOURLY job is still executing and if so, how to resubmit
>> the next job for a later time?
>      
> How about moving the SUBMIT command to the end of the HOURLY.COM?

This has the disadvantage that if the job fails somewhere in the middle, the 
next job will not be submitted, and it can take days to notice something like 
this.  (I know from experience!!)
-- 
David Morrison, Network Manager, Uni of Newcastle, Australia
Try sysnet@cc.nu.oz.au or sysnet@cc.nu.oz  (mail only)
or (VAX PSI) psi%newcastle.edu.au::sysnet or psi%0505249626002::sysnet

wadem@decus.com.au (Malcolm Wade) (07/27/89)

In article <34@mscf.med.upenn.edu>, ross@mscf.med.upenn.edu writes:
> 	We ran into the following problem yesterday.  We have a batch job
> called HOURLY.COM which runs every hour to SKIM.  The first line of 
> HOURLY.COM is a SUBMIT commmand to resubmit HOURLY at time+1 hr.  The problem
> occured when the server that we access went down and the first hourly job was
> not completed when the second one started running.  Then in a short time we
> had 3 of these hourly jobs running at once.
> 	Does anybody know an easy way to modify the com file so that it can
> dectect if another HOURLY job is still executing and if so, how to resubmit
> the next job for a later time?

There's been a few answer posted to this one - all check the queue etc...

A quick, simple fix is to get the job to submit itself 1 hour (or whatever time
period later), then change the process to, say "News Skim". If the last job is
still running, this will error and you can do what you want at this point (like
stop 'cause the job is already set to run later anyway).

I know it not really neat but then it save DCL, checking of queues etc.

Malcolm
-- 
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+
| Malcolm J. Wade,          Malcolm.Wade%decus.com.au@uunet.uu.net (Internet) |
| COMSIG Editor,              PSI%(0)505224122018::Malcolm.Wade (VAX/PSImail) |
| DECUS South Pacific Chapter.  Tel. +61 2 369 6564 (w)                       |
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+