home *** CD-ROM | disk | FTP | other *** search
/ back2roots/padua / padua.7z / padua / uucp / duucp-1.17 / AU-117b4-man.lha / man / DCron < prev    next >
Encoding:
Text File  |  1993-12-28  |  4.5 KB  |  127 lines

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