CRON.COM -------- A VMS version of the UNIX cron facility. Reads the file crontab.dat or 'nodename'_crontab.dat in a cluster every 1 Minute on Alpha (5 minutes on VAX) and performs the commands according to scheduled times. Sample Crontab -------------- # Use 5 minute increments on VAX, 1 minute increments on Alpha # output goes to [.cronlogs]'node'_cron.log by default. # minute (0-60), hour (0-23), day (1-31), month (1-12), sun-sat(0-6) # # every 15 mins 0,15,30,45 * * * * sh que/all/bat # every min(axp), every 5 min(vax) 0-55 * * * * show user # at 12:50 every day in March 50 12 * 3 * purge/nolog/keep=2 util:[log]*.log # at 01:10 every Sunday,Friday 1 10 * * 0,5 show system # every night at 22:05 5 22 * * * submit/log=util:[log]backup.log/user=backup util:[com]backup Explanation ----------- Each line contains 6 fields separated by tabs or spaces The fields are minutes (0-60), hours (0-23), days (1-31), months (1-12), day of week (1-7) and command line. The number parameters can be one of these: (can mix and match types) single number - matches exactly number-number - matches inclusive range, note that 1-3 matches 1,2, or 3 but 22-2 (for hours) matches 22,23,0,1,2. Time goes around. number,number... - matches any in list * - matches any All four time fields must match for command to be executed. Lines starting with # are comments. The DCL command goes to the end of line or to a %. If there is a % then it is taken as a EOL for the command, further elements separated by % are taken as input data lines to the command. The command is executed as a subprocess from the account running cron.com, except if it is a submit command in which case it is executed immediately. Since this is usually the system account you should consider this facility mostly for system functions. You can do something for another user by making the command a submit/user=somebody of a command file or a run/uic=something. Usage ----- - Copy cron.com to directory eg. util:[com]. - Ensure you have a crontab file in same directory called crontab.dat or 'nodename'_crontab.dat(cluster). - As Cron runs under the SYSTEM account, protect cron.com and crontab.dat with (S:RWED,O:RWED,G:RE,W:). - Insert the following command in your SYSTARTUP_VMS.COM $ @util:[com]cron start !create detached cron process - Logs are written to util:[com.cronlogs]'node'_cron.log - SYS$OUTPUT of command goes to cron log. Author ------ Rob Young, August 30, 2002 Alex Wong, 24-Sep-2003 (minor restart logic and logging changes)