From:	CRDGW2::CRDGW2::MRGATE::"SMTP::KSUVAX1.CIS.KSU.EDU::MCCALL!NEWSMGR" 26-JUL-1990 21:20:36.04
To:	MRGATE::"ARISIA::EVERHART"
CC:	
Subj:	vaxc cron part 1 of 4

Received:  by crdgw1.ge.com (5.57/GE 1.70)
	 id AA29427; Thu, 26 Jul 90 14:59:51 EDT
Resent-From: mccall!newsmgr@ksuvax1.cis.ksu.edu
Return-Path: mccall!newsmgr@ksuvax1.cis.ksu.edu
Received: from harris.cis.ksu.edu by DRYCAS.CLUB.CC.CMU.EDU; Thu, 26 Jul 90
 14:11 EST
Received: from ksuvax1.cis.ksu.edu by harris.cis.ksu.edu (5.58/SWH-2.03); id
 AA03281; Thu, 26 Jul 90 13:11:47 CDT
Received: by ksuvax1.cis.ksu.edu (5.59++/CIS1.1) id AA05247; Thu, 26 Jul 90
 13:11:40 CDT
Date: 26 Jul 90 11:09:20 GMT
From: lrb@rrivax.rri.uwo.ca
Sender: news@RIA.CCS.UWO.CA
Subject: vaxc cron part 1 of 4
To: vmsnet@DRYCAS.CLUB.CC.CMU.EDU
Message-Id: <705@ria.ccs.uwo.ca>
Resent-Date: Thu, 26 Jul 90 14:12 EST
Resent-To: VMSNET-LIST@DRYCAS.CLUB.CC.CMU.EDU
Resent-Message-Id: <5BF61179566F006638@DRYCAS.CLUB.CC.CMU.EDU>
Organization: Robarts Research Institute -- London Canada Earth
X-Envelope-To: everhart%arisia.decnet@CRDGW1.GE.COM
X-Vms-To: vmsnet@DRYCAS.CLUB.CC.CMU.EDU

=======================================================================
install.doc
-----------------------------------------------------------------------
installing mycron on the system
===============================

1. create a directory.  remember where it is.
  protection and ownership should be as follows::

CRONTEST.DIR;1       [SYSTEM]              (RWE,RWED,RWED,RWED)

stuff the files into the directory.

$ cc clontab.c
$ link clontab
$ cc mycron.c
$ link mycron
$ del *.obj

the files should be:

            CLONTAB.C
            CLONTAB.EXE
            MAILRESULTS.COM
            CLONTAB_DOC.COM
            ENTRIES.
            INSTALL.DOC
            MYCRON.C
            MYCRON.H
            MYCRON.EXE
            NULLMAN.
            STARTMYCRON.COM
            STARTUP.COM

in your systartup_v5.com (or systartup.com for pre V5.0 sites)
put the line

@device:[directory]startup
 where device:[directory] are the directory created above.

edit startup.com to have the logical cron$lib reflect the 
directory created above. NOTE that the symbol is a ROOTED directory.
(ie: ends with ".]" and not "]" )


=======================================================================
clontab_doc.com
-----------------------------------------------------------------------
$ sho log/noout sys$login
$ type/p sys$input


Some guides to using clontab and keeping your hair
==================================================

1. Clontab files

The clontab program requires input files that follow a very
firm structure. This structure, however, will allow a allow
a myriad of time combinations to by specified.

A crontab input file (for example, CRON.ENT) differs slightly
on the VAX from the UNIX version. On the Vax, each line in
CRON.ENT must be a complete entry.  This differs from the UNIX
implentation which allows a cron entry to span several lines in
the CRON.ENT.

The other difference between the two implementations is in value
ranges. In the UNIX implementation a range such as
   00-20
would specify all values between 0 and 20. On the VAX/VMS version,
this is instead specified as:
   00,01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16,17,18,19,20.


3. An example

Let us now examine a typical clontab file.

-------start of file--------
# UNISRC_ID:	@(#)crontab entry 27.1

0,15,30,45 * * * 2,3,4,5,6 user1:[lrb.cron]mailcheck.com /priority=1
50 * * * 1 user1:[lrb.cron]mailcheck.com 
--------end of file---------

This file has two crontab submissions in it. The first line is
a comment, for it starts with a pound (#) symbol.  The  blank line is
ignored.

This file controls when the com file, user1:[lrb.cron]mailcheck.com, is
run. ALL SUBMISSIONS TO CRON MUST BE IN THE FORM OF A COM FILE. This is
because cron executes your requests by submitting them to the batch
queue under your name. 

A crontab request is made up of six fields:
	minutes (0-59)
	hours (0-23)
	day of month (1-31)
	month of year (1-12)
	day of week (0-6 with 0 = Sunday)
	command

In our example, the fields of the first submission are:
	minutes: 0,15,30,45
	hours: *
	month day: *
	month: *
	day of week: 2,3,4,5,6
	command: user1:[lrb.cron]mailcheck.com /priority=1

In our example, the two requests define that the file mailcheck.com
be submitted to batch every fifteen minutes Tuesday through Saturday 
(with priority 1), at ten minutes to the hour on Mondays and never on
Sundays. 

3. Your LOGIN.COM file

Because you are logged in by batch, your LOGIN.COM is executed as
your clontab submission is run. If you set your process name within batch
AND you are logged in when the clontab submission is made, then
your batch submission will end with a "duplicate process name error".
The way to avoid this is by skipping over most of your LOGIN.COM by
checking the mode of your login with the f$mode() lexical function.
The following is an example of such an approach:

    if f$mode() .NES. "INTERACTIVE" then goto END
     < your personal login stuff >
    END:                                        $!last line of file

Another way would be to insert the line:

       set Noon

in your login.com which will allow the duplicate process
name error to be non-fatal.


4. Where does the output go?

Although clontab entries define batch submissions, output is not handled
in the same manner as a batch file submission. When a cron execution is
finished the output is mailed back to the user. There are two exceptions to
this rule. The first is if your clontab entry specifies /NOLOG. The second
is if you specify /LOG or /LOG=filename, in which case the output is collected
in a file in your home directory.

examples:
1. - output collected and mailed back to user
    50 * * * 1 user1:[lrb.cron]mailcheck.com 

2. - output collected into a file called mailcheck.log
    50 * * * 1 user1:[lrb.cron]mailcheck.com/LOG

3. - output collected into a file called batch.log
    50 * * * 1 user1:[lrb.cron]mailcheck.com/LOG=BATCH.LOG

4. - output not collected
    50 * * * 1 user1:[lrb.cron]mailcheck.com/NOLOG


5. clontab usage

put the following line in your login.com

$ CLONTAB == "$CRON$LIB:[000000]CLONTAB CLONTAB"

this will allow you to use clontab as a foreign command


clontab               --> generates usage line
clontab -l            --> list current entry
clontab -d            --> delete current entry
clontab filename.ext  --> use "filename.ext" as a new entry

6. bugs
if a comment line (line staring with #) has nothing but the #
on it, then the line immediatly following it in a clontab file should
be a blank line, or another comment. 

7. author
_________________________________
Lance R. Bailey, Systems Manager | Robarts Research Institute
email: lrb@rri.uwo.ca            | Clinical Trials Resources Group
  vox: 519-663-3787 ext. 4108    | P.O. Box 5015, 100 Perth Dr.
  fax: 519-663-3789              | London, Canada N6A 5K8

8. copyright

author 1990.

=======================================================================
_________________________________
Lance R. Bailey, Systems Manager | Robarts Research Institute
email: lrb@rri.uwo.ca            | Clinical Trials Resources Group
  vox: 519-663-3787 ext. 4108    | P.O. Box 5015, 100 Perth Dr.
  fax: 519-663-3789              | London, Canada N6A 5K8
