home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / CRONRF.ZIP / cronrgf.txt < prev    next >
Text File  |  1992-06-10  |  4KB  |  122 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 [/Test] cronfile
  18.  
  19. Reads file 'cronfile' and executes command[s] repeatedly according to it.
  20.  
  21. 'cronfile' has to be formatted like in Unix; unlike the Unix-version a 
  22. percent-sign (%) is treated like any other character; empty lines and ones 
  23. starting with a semi-colon (;) are ignored.  
  24.  
  25. If switch '/Test' is given, the file is read and the user is presented
  26. with the date/times and commands to be executed.
  27.  
  28. Examples
  29. ========
  30.           CRONRGF d:\os2\system\crontab
  31.           ... execute statements in file 'crontab' located in "D:\OS2\SYSTEM"
  32.  
  33.           CRONRGF /TEST testcron
  34.           ... execute statements in file 'testcron' in testmode
  35.  
  36.  
  37.  
  38. LAYOUT of the control file
  39. ==========================
  40.  
  41. minute hour day month weekday command
  42.      --- or ---
  43. * * * * * command
  44.  
  45. where minute  ranges from 0-59,
  46.       hour    ranges from 0-23,
  47.       day     ranges from 1-31,
  48.       month   ranges from 1-12,
  49.       weekday ranges from 1-7 (1 = Monday, 2 = Tuesday, ..., 7 = Sunday)
  50.  
  51. you can specify a list of values, separated by a comma (,), e.g. "1,3,7"
  52. you can specify a range of values, separated by a dash (-), e.g. "1-5"
  53. you can specify a star (*) instead of a value, meaning entire range of all valid
  54.     values
  55.  
  56. Blank lines and ones starting with a semi-colomn (;) are ignored. A command will
  57. only be executed if ALL critereiae are fullfilled, i.e. only if the specified 
  58. minute, hour, day, month and weekday arrived.
  59.  
  60. Sample file
  61. ===========
  62.  
  63. ; This is a comment (starts with a semicolumn) =================================
  64. ; empty lines are ignored too...
  65.  
  66.  
  67. ;
  68. ; the given command is only executed when all criteria are fullfilled !
  69. ;
  70.  
  71. ; the following command "@ECHO HI, I am Nr. 1 to be echoed every minute" would be
  72. ; executed every minute
  73. *  *  *  *  *  @ECHO Hi, I am Nr. 1 to be echoed every minute & pause
  74.  
  75. 59 23 31 12 5 command, one minute before year's end, and only if the last day is a Friday
  76.  
  77. ; comment: every year at 17:45 on June 7th:
  78. 45 17  7  6  *  dir c:\*.exe
  79.  
  80. ; comment: on every full quarter of an hour 
  81. ;          at midnight, 6 in the morning, noon, 6 in the evening
  82. ;          on the 1st, 15th and 31st of 
  83. ;          every month on
  84. ;          weekdays only
  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:
  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. ; at midnight on every month:
  99. 0 0 1 * * tapebackup /all
  100.  
  101. ; execute every minute, no restrictions:
  102. *  *  *  *  *  @ECHO Hi, I am Nr. 2 to be echoed every minute & pause
  103.  
  104. ; execute every minute in January, February, March only !
  105. * *  *  1,2,3  *  any-command
  106.  
  107. ; execute every day at midnight
  108. 0 0 * * * any-command
  109.  
  110. ; execute every wednesday at midnigth !
  111. 0 0 * * 3 any-command
  112.  
  113. ; this is a comment which concludes the sample file ===========================
  114.  
  115.  
  116.  
  117. Rony G. Flatscher,
  118. Vienna/Austria/Europe,
  119. Wirtschaftsuniversitaet Wien
  120. 1992-06-10
  121.  
  122.