home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / amiga / comms / network / amigauuc.lha / AmigaUUCP / man / DCron < prev    next >
Text File  |  1992-05-06  |  5KB  |  133 lines

  1.  
  2.                 DCRON.DOC
  3.  
  4.                   UNIX-like CRON
  5.  
  6.                   V2.00
  7.                   7 August 1989
  8.  
  9.                   Matthew Dillon
  10.                   891 Regal Rd
  11.                   Berkeley, Ca. 94708
  12.  
  13.                  dillon@ucbvax.Berkeley.edu
  14.                  ...!ucbvax!dillon
  15.  
  16. DESCRIPTION:
  17.  
  18.     Those not familar with the UNIX cron command probably do not need it.
  19.  
  20.  
  21. INSTALLATION:
  22.     the NULL: device must be mounted
  23.  
  24.     an s:crontab file must exist (see instructions below)
  25.  
  26.     1.3 RUN required so you can: run <nil: >nil: dcron <logfile>
  27.  
  28.     copyadd l/null-handler into your l: and add the appropriate
  29.     Mountlist entry to your devs:Mountlist (see included Mountlist
  30.     file)
  31.  
  32.     Create S:crontab with entries as you like.
  33.  
  34. INSTRUCTIONS:
  35.  
  36.     NOTE:   * All cron-commands are automatically RUN  in the background,
  37.           you do not need to say 'run' in the command argument of the
  38.           s:crontab file
  39.  
  40.         * You do not have to redirect standard command output.  I.E.
  41.           if you do a 'List' from cron, the output is sent to the
  42.           cia.
  43.  
  44.         * DCRON WORKS ONLY WITH 1.3, specifically, the 1.3 RUN command
  45.           must be installed.
  46.  
  47.         * DO NOT RUNBACK CRON!!!  Use: run <nil: >nil:
  48.  
  49.         * You may want your PATH to be setup before running DCron so
  50.           DCron gets your path.
  51.  
  52.     Inspired by Rick Schaeffer's AmigaCron.  I decided to write this
  53. one from scratch.  The program is crontab file compatible with Rick's
  54. and the UNIX cron tab format with the same exceptions as Rick had.
  55. Specifically, the % char is not implemented and the day-of-week is
  56. ranged 0-6 (Sun-Sat) rather than the UNIX 1-7 (Mon-Sun).
  57.  
  58.     The major purpose of this program, apart from yielding the functionality
  59. of cron, is the addition of major time optimizations.  The program loads
  60. s:crontab into memory and only reloads if the datestamp of the file has been
  61. modified (checked every 60 seconds).  DCron also checks if the user has
  62. modified the system time.
  63.  
  64.     The result is that my cron takes virtually no CPU.
  65.  
  66.     [run <nil: >nil:] DCron [-d] logfile
  67.  
  68.     Using the 1.3 RUN command and redirecting both stdin and stdout to NIL:,
  69.     you can safely close the CLI window that you ran DCron in.
  70.  
  71.     The logfile is a required argument and logs all errors and status
  72. messages.  Under normal conditions this file does not get very big.
  73. Cron does an open-append/write/close sequence every time it logs a message
  74. allowing you to cat, edit, or even remove the file with cron running.
  75. (If you remove it, the next logged message will cause the file to be
  76. re-created).
  77.  
  78.     The -d option, for debug, is used for debugging and logs additional
  79. information.  (may not be implemented in release)
  80.  
  81.     The control file is S:CRONTAB and may contain one of three types of
  82. lines:    (1) A blank line, (2) A line beginning with a hash ``#'' which
  83. introduces a comment, (3) A cron line of 5 or 6 fields:
  84.  
  85. <min> <hour> <day> <month> <dayofweek>    [<command>]
  86.  
  87.     Each field <min> to <dayofweek> can be either a single asterix ``*''
  88. which matches all times, or a comma delimited list of numbers or ranges
  89. which must be in numerical order.  Assume the control file is scanned
  90. every minute.  On every minute, each field that matches the current
  91. time, day, and day of week will be executed.
  92.  
  93.     The <command> field is optional.  If no command is given the date is
  94. simply logged to the logfile (as well as the cron line that caused it).
  95. If a command is given, it is a CLI command and is automatically RUN
  96. (asynchronous from the cron task).  Standard in/out is NIL:  The cron line
  97. that ran the command is logged.
  98.  
  99. * * * * *   Date
  100.  
  101.     Would execute the Date command every minute.  The output is ignored.
  102.     I.E. useless.  Also, running something every minute wastes CPU.
  103.  
  104. 0-3,5,7,40-50 * * * *    Date
  105.  
  106.     Would execute it at the hour, 1 past, 2 past, 3 past, 5 past, 7 past,
  107.     40 41 42 ... and 50 past every hour.  Combinations can be used to
  108.     yield more interesting results:
  109.  
  110. 0 0,12 * * 0    Date
  111.  
  112.     Would run Date at midnight and 12 noon, but only on sunday.
  113.  
  114. 0 0 25 12 *    Echo >ram:x "Merry Cristmas"
  115.  
  116.     Would execute the Echo command at midnight beginning christmas day and
  117.     stick it in ram:x.
  118.  
  119. * * * * 2-3 Date
  120.  
  121.     Is useless ... execute the Date command every minute but only if the
  122.     day is a tuesday or wednesday (i.e. 1440 times on tuesday, 1440
  123.     times on wednesday, nothing for any other day).
  124.  
  125. 0 4 * * 1     shell >ram:backups -c "ChangeTaskPri -1;dobackups"
  126.  
  127.     Would run a shell script to do my HD backup at 4:00 A.M. every Monday.
  128. (I have the advantage of having two physical drives and can back one up
  129. to the other without user intervention).  This would also be useful to
  130. backup something to a remote host if you are on a network.
  131.  
  132.  
  133.