home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / cronrgf.zip / CRONrgf.txt < prev    next >
Text File  |  1993-11-08  |  5KB  |  125 lines

  1. Infos on CRONRGF.CMD
  2. ====================
  3.  
  4. CRONRGF.CMD was modelled after the "cron"-utility of Unix. It allows you to 
  5. specify in a control files on which times and dates a command should be executed
  6. repeatedly.
  7.  
  8. CRONRGF.CMD starts and runs forever, dispatching the commands at the given 
  9. times. 
  10.  
  11. Please check ATRGF.CMD which was modelled after the OS/2-LAN-command "at" for 
  12. another variant having features not found in CRONRGF.CMD.
  13.  
  14. Usage
  15. =====
  16.  
  17.     CRONRGF [/T] [/M] [/R[nn]] [/B] cronfile
  18.  
  19.     
  20.     Reads file 'cronfile' and executes command[s] repeatedly according to it.
  21.     'cronfile' has to be formatted like in Unix; unlike the Unix-version a '%' is
  22.     treated like any other character; empty lines and ones starting with
  23.     a semi-colon (;) or a (#) are ignored.
  24.    
  25.     Switch '/T[estmode]': the cronfile is read and the user is presented with the date/times
  26.           and commands to be executed upon them. The planned and truly scheduled 
  27.           times are written to the log-file.
  28.  
  29.     Switch '/M[idnight]': all commands which were scheduled the same day, starting from
  30.           midnight to the time of first invocation are executed once.
  31.  
  32.     Switch '/R[nn]': check cronfile at least every 'nn' (default 60) minutes whether it changed; if so, reread
  33.           it immediately and set the new schedule-times. If set, the cronfile will be checked for changes after
  34.           executing commands
  35.    
  36.     Switch '/B[lackAndWhite]': do not colorize output strings (e.g. for usage in more, less etc.).
  37.           This switch merely suppresses the ANSI-color-sequences attached to the
  38.           strings.
  39.  
  40.     example:  CRONRGF /TEST testcron
  41.               execute statements in file 'testcron' in testmode
  42.  
  43.     example for a control-file:
  44.  
  45.         ; Sample file for CRONRGF.CMD
  46.         ;
  47.         ; This is a comment (starts with a semicolumn)
  48.         # This is a comment too (starts with the Unix-comment symbol)
  49.         ; empty lines are ignored too...
  50.         
  51.         
  52.         ; LAYOUT OF THE CRON-FILE:
  53.         ;    * * * * * command
  54.         ; or
  55.         ;    minute hour day month weekday command
  56.         ; where minute  ranges from 0-59,
  57.         ;       hour    ranges from 0-23,
  58.         ;       day     ranges from 1-31,
  59.         ;       month   ranges from 1-12,
  60.         ;       weekday ranges from 1-7 (1 = Monday, 2 = Tuesday, ..., 7 = Sunday)
  61.         ;
  62.         ; you can give a list of values, separated by a comma (,), e.g. "1,3,7"
  63.         ; you can give a range of values, separated by a dash (-), e.g. "1-5"
  64.         ; you can give a star (*) instead of a value, meaning entire range of all valid values
  65.         ;
  66.         ; the given command is only executed when all criteriae are fullfilled !
  67.         ;
  68.         ; restriction: unlike to Unix, the percent-sign (%) is treated like any other character and
  69.         ;              not as a new-line
  70.         ;
  71.         
  72.         # the following command "@ECHO HI, I am Nr. 1 to be echoed every minute" would be
  73.         # executed every minute
  74.         *  *  *  *  *  @ECHO Hi, I am Nr. 1 to be echoed every minute & pause
  75.         
  76.         59 23 31 12 5 command, one minute before year's end, and only if the last day is a Friday
  77.         
  78.         ; comment: every year at 17:45 on June 7th:
  79.         45 17  7  6  *  dir c:\*.exe
  80.         
  81.         ; comment: on every full quarter of an hour 
  82.         ;          at midnight, 6 in the morning, noon, 6 in the evening
  83.         ;          on the 1st, 15th and 31st of 
  84.         ;          every month on
  85.         0,15,30,45   0,6,12,18   1,15,31   *   *   backup c:\*.* d:\ /s
  86.         
  87.         ; at noon on every day, if it is a weekday (Mo-Fri):
  88.         0 12 * * 1-5 XCOPY Q:\* D:\ /s
  89.         
  90.         ; every minute in January, March, May, July, September and November:
  91.         *  *  *  1,3,5,7,9,11  *  dir c:\*.cmd
  92.         
  93.         # at the last day of the year at 23:01, 23:02, 23:03, 23:05, 23:20, 23:21,
  94.         # 23:22, 23:23, 23:24, 23:25, 23:30, 23:31, 23:32, 23:33, 23:34, 23:35,
  95.         # 23:59
  96.         1,2,3,5,20-25,30-35,59   23   31   12   *   COPY D:\*.log E:\backup
  97.         
  98.         ; make backups of OS2.INI and OS2SYS.INI on every first monday of a month,
  99.         ; at 9 o'clock in the morning
  100.         0 9 1-7 * 1 showini /bt d:\os2\os2.ini
  101.         0 9 1-7 * 1 showini /bt d:\os2\os2sys.ini
  102.         
  103.         ; at midnight on every month:
  104.         0 0 1 * * tapebackup /all
  105.         
  106.         ; execute every minute, no restrictions:
  107.         *  *  *  *  *  @ECHO Hi, I am Nr. 2 to be echoed every minute & pause
  108.         
  109.         # execute every minute in January, February, March only !
  110.         * *  *  1,2,3  *  any-command any-arguments
  111.         
  112.         # execute every day at midnight
  113.         0 0 * * * any-command any-arguments
  114.         
  115.         # execute every wednesday at midnigth !
  116.         0 0 * * 3 any-command any-arguments
  117.         
  118.         # this is a comment which concludes the sample file ===========================
  119.  
  120.  
  121. Rony G. Flatscher,
  122. Vienna/Austria/Europe,
  123. Wirtschaftsuniversitaet Wien
  124. 1992-11-08
  125.