home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 182.lha / ARexxCron / RXCron.doc < prev    next >
Text File  |  1988-04-28  |  6KB  |  139 lines

  1.        RXCRON, a "cron" program for the Amiga ARexx environment.
  2.  
  3. INTRODUCTION
  4. ------------
  5. For all you REXXophiles, here's another one: "RXCron".
  6. RXCron is an ARexx clone of "AmiCron", a program that
  7. automatically runs commands at predetermined times.
  8. Briefly stated, once a minute RXCron looks at a "crontab" file to check
  9. whether the current date/time matches any of the entries in the file;
  10. if so, the DOS command specified in the matching entry is issued.
  11.  
  12. RXCron is intended to be compatible with AmiCron v2.4.  You should be
  13. able to use the same (unmodified) crontab file you used with AmiCron.
  14. I wrote RXCron because I use WShell (another fine product from
  15. Bill Hawes), and I wanted my crontab commands to be able to use the shell.
  16. (However, WShell is not required to use RXCron).
  17.  
  18. I think RXCron has a few advantages over AmiCron.  Namely:
  19.    - it fits nicely into the ARexx/WShell environment
  20.    - saves about 7000 bytes of disk/ram space over AmiCron
  21.    - source can be easily customized by the user
  22.    - RXCron reads the crontab file only once.  Thereafter, it
  23.        just checks the file's time stamp, and rereads it only
  24.        if the file has been modified since it last looked.
  25.    - it types a "log" message whenever it issues a command
  26.  
  27. This file package should contain:
  28.     RXCron.rexx               the program
  29.     RXCron.doc                you're reading it
  30.     datebug.txt               description of ARexx bug in DATE(), and patch
  31.  
  32. RXCRON IS IN THE PUBLIC DOMAIN.  AS SUCH, IT IS OFFERED "AS-IS".
  33.  
  34.  
  35. PREPARATION
  36. -----------
  37. Note: you must use ARexx version 1.06 or better to run RXCron,
  38. because it uses the new Delay, Date, and improved StateF functions.
  39.  
  40. Note: you must have added the "rexxsupport.library" to the ARexx library
  41. list.  I use the RXLIB command to do this in my startup-sequence.
  42.  
  43. If you edit the RXCron.rexx file, notice the first executable line is:
  44.     runprog="run >nil:"
  45. This defines the run program that RXCron will use to launch commands.
  46. I use WShell, so mine is "runwsh >nil:".  You may want to change this to
  47. ARP's ARun, or RunBack, etc.,  or just leave it as RUN.
  48.  
  49.  
  50. STARTING THE PROGRAM
  51. --------------------
  52. RXCron should be run in a separate CLI or WShell, because the program
  53. runs continuously, and because a window is needed to print messages
  54. from RXCron and the launched commands.  To run the program:
  55.       RX RXCron              (start program, using S:crontab)
  56.  or   RX RXCron [file]       (start program, using other crontab file)
  57. The RX is not necessary if you are using WShell.
  58.  
  59. If RXCron is started from startup-sequence, be sure it gets started
  60. *after* the REXX host is up and running (this should go without saying).
  61.  
  62. Since RXCron runs continuously, you may need to kill it.  To do this,
  63. issue from another CLI: "RX RXCron -k".  This signals the running
  64. RXCron (ALL of them that may be running) to quit.  It won't terminate
  65. until the program wakes up again, which may take up to 1 minute.
  66.  
  67.  
  68. CRONTAB FILES
  69. -------------
  70. RXCron requires that the user provide a "crontab" file.  This file
  71. contains specifications of the date/time of events and the commands
  72. to issue at those times.  Use a favorite text editor to create yours.
  73. The default file name RXCron looks for is "S:crontab", but you may
  74. specify another.  Whatever it's called, you will probably want the
  75. file to be located in a RAM disk, to avoid requesters and disk gronking.
  76.  
  77. The file is organized as one event per line.  Each line consists of
  78. 5 numbers followed by a command, all separated by spaces or tabs:
  79.  
  80.    n1 n2 n3 n4 n5 command
  81.  
  82. "n1" is the minute specification: 0 to 59
  83. "n2" is the hour   specification: 0 to 23
  84. "n3" is the day    specification: 1 to 31
  85. "n4" is the month  specification: 1 to 12
  86. "n5" is the day-of-week specification: 0 to 6 for Sunday to Saturday.
  87. "command" is the AmigaDOS or WShell command to be run.
  88.  
  89. ALSO, each number may be specified as:
  90.   An asterisk (*), for "don't care" or "all".
  91.   A list, with each number separated by commas. e.g:  0,15,30,45
  92.   A range, with two numbers separated by a dash. e.g: 15-31
  93.  
  94. Careful, RXCron does not check that numbers are within a valid range.
  95.  
  96. Examples:
  97.   * * * * * date              (prints date every minute)
  98.   0,30 * * * * rx cuckoo      (announce time every hour and half hour)
  99.   30 4 * * 1-5 uupc           (run uupc at 4:30am every day except Sat,Sun)
  100.   30 19 * * 1,3,5 backup      (backup files every other day at 7:30pm)
  101.   0 8 25 12 * playjinglebells (play _Jingle Bells_ at 8am on Christmas)
  102.  
  103. AREXX BUGS
  104. ----------
  105. While writing this program, I came across a few ARexx bugs.  Bill Hawes
  106. has informed me that patches for these will be posted soon.   For now,
  107. the bugs can be circumvented.  Here are the circumventions I used;
  108. do not change these lines unless you have patched the bugs.
  109.   - The SETCLIP at line 21 must have an even number of zeroes: "00".
  110.       This avoids a GURU when the StateF function is called later.
  111.   - The PARSE statement at line 25 uses junk variables "a b c d e" instead
  112.       of placeholders (.) .  This avoids a bug which slowly eats storage.
  113.   - The Match function at line 60 does not use PROCEDURE. Storage eater again.
  114.  
  115. Allegedly there is a bug in the ARexx version 1.06 DATE() function,
  116. as reported by in a USENET article, part of which I have included here
  117. in the "datebug" file.  I am using the patch described in the article
  118. with no apparent ill effects.  But, use the patch at your own risk.
  119.  
  120.  
  121. REVISION HISTORY
  122. ----------------
  123. 0.2  first public domain release
  124. 0.1  intermediate version, "not entirely successful"
  125. 0.0  first draft
  126.  
  127. ---------------
  128.  
  129. Thanks to the authors of the original AmiCron program:
  130.  Steve R. Sampson, Rick Schaeffer, Christian Balzer.
  131.  
  132. Thanks to Bill Hawes for ARexx and WShell.
  133.  
  134.  
  135. Questions, comments, improvements:
  136.   Robert Rethemeyer at BBS-JC (415/961-7250).
  137.  
  138. Good Luck with RXCron.
  139.