home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / que09.zip / que.doc < prev    next >
Text File  |  1994-04-06  |  15KB  |  361 lines

  1.  
  2.                             QUE version 0.9
  3.                Job Scheduler & Queue System for OS/2 2.x
  4.  
  5.         Copyright (c)1994 by Lai Zit Seng. All Rights Reserved.
  6.  
  7.  
  8. QUE is a job scheduler and queue system for OS/2 2.x. QUE lets you
  9. schedule jobs for sequential processing in a queue. You can schedule
  10. jobs to be processed repeatedly. QUE has an easy to use command line
  11. interface and provides flexible scheduling options.
  12.  
  13. QUE lets you run jobs (programs, batch files, etc) like the OS/2 START
  14. command. However QUE lets you delay processing until a later time and
  15. repeatedly process the job at a given interval. Jobs are queued
  16. sequentially (by default); If two or more jobs are scheduled to be
  17. processed together, QUE will only process them one after the other.
  18. OS/2's multitasking is great, but starting too many jobs simultaneously
  19. may slow down your system unnecessarily.
  20.  
  21. I use QUE on my BBS to process mail, generate reports and filelists,
  22. make out-going mail calls, etc.
  23.  
  24.  
  25. COPYRIGHT, DISTRIBUTION AND DISCLAIMER NOTICE
  26. ─────────────────────────────────────────────
  27.  
  28. QUE is Copyright (c)1994 by Lai Zit Seng. All rights are reserved.
  29.  
  30. This software may be used free of charge. Non-profit distribution is
  31. permitted provided the QUE distribution archive/package remains intact.
  32. Modification and/or tampering with QUE or its associated files is
  33. expressly prohibited.
  34.  
  35. QUE is provided as is and comes with no warranty of any kind, express or
  36. implied, including but not limited to that of quality, performance,
  37. merchantability and fitness for any particular purpose. In no event will
  38. the author be liable for any damages resulting from the direct or
  39. indirect use, or the inability to use, this software. The user bears all
  40. risk with regards to the use or inability to use this software.
  41.  
  42.  
  43. CONTENTS OF THIS PACKAGE
  44. ────────────────────────
  45.  
  46. The distribution archive you receive for this software contains the
  47. following files:
  48.  
  49.     QUE.EXE         The actual executable program
  50.     QUE.DOC         This documentation
  51.     FILE_ID.DIZ     Blurb for BBS file listing
  52.     STARTQUE.CMD    Starts the queue server in a minimized session
  53.     SAVEQUE.CMD     Saves the state of the queue for later retrieval
  54.  
  55.  
  56. USING QUE - STARTING THE SERVER
  57. ───────────────────────────────
  58.  
  59. There are two parts to QUE - the server mode that monitors your job
  60. schedules and processes them, and the client mode that sends jobs and
  61. acts as a general interface to the server.
  62.  
  63. You must start the server mode before using any other QUE commands. To
  64. do so, type:
  65.  
  66.     QUE /SERVER
  67.  
  68. You can optionally specify a queue number for this particular server
  69. mode to operate on. This lets you run multiple queues on your system. To
  70. do so, include the /QUEUE parameter:
  71.  
  72.     QUE /SERVER /QUEUE n
  73.  
  74. where n is the queue number. To end the queue server, run another copy
  75. of it with:
  76.  
  77.     QUE /STOP
  78.  
  79.  
  80. USING QUE - SUBMITTING JOBS
  81. ───────────────────────────
  82.  
  83. There are many ways to queue jobs for execution. The general formats
  84. are:
  85.  
  86.     QUE <command>                       <=  starts job now
  87.     QUE AT hh:mm <command>              <=  starts job at the given time
  88.                                             today (hh:mm)
  89.     QUE ON dd-mm-yy <command>           <=  starts job on the given day
  90.                                             (dd-mm-yy) at the current
  91.                                             time
  92.     QUE AT hh:mm ON dd-mm-yy <command>  <=  starts job on the given day
  93.                                             and at the given time
  94.     QUE IN n MINUTES <command>          <=  starts job in n minutes
  95.     QUE IN n HOURS <command>            <=  starts job in n hours
  96.     QUE NEXTHOUR <command>              <=  starts job in 1 hour
  97.     QUE NEXTDAY <command>               <=  starts job in 1 day's time
  98.     QUE NEXTWEEK <command>              <=  starts job in 7 days' time
  99.  
  100. In all examples above, <command> represents the actual command line
  101. including parameters needed to start your job. QUE saves your current
  102. directory when you submit your job; The server chances to this directory
  103. before processing your job.
  104.  
  105. The hh:mm time value is in 24 hour format (00:00 to 23:59).
  106.  
  107. QUE's keywords can be mixed in any other, as long as <command> remains
  108. right at the end. For example, you can type:
  109.  
  110.     QUE ON dd-mm-yy AT hh:mm <command>
  111.     QUE NEXTHOUR NEXTDAY IN 6 MINUTES <command>
  112.  
  113. The first is self explanatory. The second example simply means to start
  114. the job one day and 1 hour 6 minutes from now.
  115.  
  116. The year component of the date value can be in 4 digit format. This
  117. means that the following commands are identical:
  118.  
  119.     QUE ON 4-4-94 <command>
  120.     QUE ON 4-4-1994 <command>
  121.  
  122. To schedule repeating jobs, use the EVERY... keywords:
  123.  
  124.     QUE EVERYQUATER                     <= job repeats every quater-hour
  125.     QUE EVERYHALF                       <= job repeats every half-hour
  126.     QUE EVERYHOUR                       <= job repeats every hour
  127.     QUE EVERYDAY                        <= job repeats every day
  128.     QUE EVERYWEEK                       <= job repeats every week
  129.     QUE EVERYMONTH                      <= job repeats every month
  130.     QUE EVERYYEAR                       <= job repeats every year
  131.     QUE EVERY n MINUTES                 <= job repeats every n minutes
  132.     QUE EVERY n HOURS                   <= job repeats every n hours
  133.  
  134. These frequency specifying keywords can be mixed with start-time
  135. specifying keywords described earlier to give, as an example:
  136.  
  137.     QUE AT hh:mm ON dd-mm-yy EVERY n HOURS <command>
  138.  
  139. The following lists more of QUE options:
  140.  
  141.     /DIR <directory>                    <=  change to the specified
  142.                                             directory before starting
  143.                                             job
  144.     /INSTANCES n                        <=  maximum of n instances of
  145.                                             this command (including the
  146.                                             one now being submitted)
  147.     /QUEUE n                            <=  use queue n (default is 1)
  148.     /DETACH                             <=  job will be detached to a
  149.                                             background process
  150.  
  151. The /INSTANCES keyword let you specify the maximum number of the job you
  152. are submitting that is allowed in the queue. This includes the one that
  153. you are going to submit. Jobs are considered identical so long as their
  154. <command> strings are identical (whitespace is ignored). If there are
  155. already 2 instances of TEST.CMD in the queue, the following will fail:
  156.  
  157.     QUE /INSTANCES 2 TEST.CMD
  158.  
  159. But the following succeeds:
  160.  
  161.     QUE /INSTANCES 3 TEST.CMD
  162.  
  163. The /DETACH keyword specifies that the job will be "spawned off" and
  164. executed in the background. Detached jobs cannot be viewed on the screen
  165. and cannot accept keyboard/mouse input. If several jobs are scheduled
  166. for the same time, detached jobs are always processed first. If you want
  167. to run a job "in the background" (not occupying QUE's time) but want to
  168. see its screen output and provide keyboard/mouse input, use:
  169.  
  170.     QUE START <command>
  171.  
  172. START is an OS/2 command that starts a new session. QUE merely passes
  173. "START <command>" to the OS/2 command processor.
  174.  
  175.  
  176. USING QUE - MANAGEMENT TOOLS
  177. ────────────────────────────
  178.  
  179. The following keywords are provided to manage your queue:
  180.  
  181.     QUE /STOP                           <=  Stops the queue server (the
  182.                                             current job is always
  183.                                             completed first before
  184.                                             shutting down)
  185.     QUE /LIST                           <=  Tabular list of all jobs
  186.                                             scheduled
  187.     QUE /VERBOSE n                      <=  Detailed information of the
  188.                                             schedule for job ID n
  189.     QUE /KILL n                         <=  Remove the schedule for job
  190.                                             ID n
  191.     QUE /SAVE                           <=  output a command file that
  192.                                             can restore the queue to the
  193.                                             current state
  194.  
  195. /STOP ends the queue server. The current job is always completed first
  196. before the serve mode shuts down.
  197.  
  198. /LIST generates output of the form:
  199.  
  200.     1004 05-04-1994 22:55 W    test4
  201.     1001 05-04-1994 23:00 W    test1
  202.     1007 06-04-1994 02:36 W hr test5
  203.     1002 06-04-1994 22:35 W    test2
  204.     1003 12-04-1994 22:35 W    test3
  205.     1008 12-04-1994 22:45 W ?m test6
  206.     ^    ^          ^       ^  ^
  207.     |    |          |       |  +------- command
  208.     |    |          |       +---------- frequency for repeated jobs: qt,
  209.     |    |          |                   hf, hr, dy, wk, mn, yr, ?m, ?h
  210.     |    |          |                   for quarter-hourly, half-hourly,
  211.     |    |          |                   hourly, daily, weekly, monthly,
  212.     |    |          |                   yearly, in "some" interval of
  213.     |    |          |                   minutes and in "some" interval
  214.     |    |          |                   of hours
  215.     |    |          +------------------ the start time of this job
  216.     |    +----------------------------- the start date of this job
  217.     +---------------------------------- Job ID
  218.  
  219. /SAVE generates an output that makes up all the QUE commands required to
  220. restore your queue to its current state. This is a convenient meants to
  221. restore your queue after a system reboot. The output for the above
  222. schedules look like:
  223.  
  224.     que at 22:55 on 05-04-1994 /dir F:\work\queue test4
  225.     que at 23:00 on 05-04-1994 /dir F:\work\queue test
  226.     que at 02:36 on 06-04-1994 everyhour /dir F:\work\queue test5
  227.     que at 22:35 on 06-04-1994 /dir F:\work\queue test2
  228.     que at 22:35 on 12-04-1994 /dir F:\work\queue test3
  229.     que at 22:45 on 12-04-1994 every 50 minutes /dir F:\work\queue test6
  230.  
  231. If you run "QUE /SAVE > RESTORE.CMD", then after your system reboots,
  232. running "RESTORE.CMD" restores the queue to what it previously was.
  233.  
  234. The /LIST and /VERBOSE commands sorts according to the order that the
  235. queue will be processed. This means that the earliest job is listed
  236. first. For all jobs scheduled for the same time, detached jobs are listed
  237. first. The last sort criteria is by job ID - this means that if two
  238. job (both detached or both not detached) are scheduled at the same time,
  239. the job submitted earlier is listed first (job IDs are assigned in
  240. ascending order).
  241.  
  242. The /VERBOSE gives detailed information about the specified job ID. With
  243. the above example of jobs, running "QUE /VERBOSE 1008" produces:
  244.  
  245.     Job ID: 1008  Frequency: Every 50 minutes  Executed: 0 times
  246.     Date: 12-04-1994  Time: 22:45  Run Mode: Wait
  247.     Directory: F:\work\queue
  248.     Command:   test6
  249.  
  250. The "Processed: n times" field is useful only for repeating jobs. This
  251. tells you how many times this job has already been processed. The Date
  252. and Time fields of repeating jobs reflect the date/time of the next run,
  253. not that of the original run.
  254.  
  255.  
  256. TIPS FOR USING QUE
  257. ──────────────────
  258.  
  259. The STARTQUE.CMD file provided starts QUE in a windowed, minimized
  260. session directly without going through the command processor. When the
  261. QUE server is stopped, this window is closed automatically. STARTQUE.CMD
  262. contains this line:
  263.  
  264.     start /n /win /min que /server
  265.  
  266. You can include this line in STARTUP.CMD in the root directory of your
  267. OS/2 boot drive to automatically start the QUE server at boot time.
  268.  
  269. If you like to have QUE save its current schedule to a file
  270. automatically at some fixed interval, schedule the following job:
  271.  
  272.     que every 20 minutes saveque.cmd
  273.  
  274. SAVEQUE.CMD is included in this distribution archive. It contains the
  275. following line:
  276.  
  277.     que /save > queagain.cmd
  278.  
  279. When you reboot your system, run "queagain.cmd" to restore your schedule
  280. to what it was when your system when down. This command is very useful
  281. in restoring your queue in the event of a system crash or other
  282. unexpected shutdown. In fact, you might want to include this "autosave
  283. feature" in STARTUP.CMD after starting the QUE server.
  284.  
  285.  
  286. OTHER NOTES
  287. ───────────
  288.  
  289. If you want to run a command that is the same as one of QUE's keywords,
  290. prefix your command with a minus sign. For example, if you want to run a
  291. command called AT, the following results in an error:
  292.  
  293.     QUE IN 5 MINUTES AT
  294.  
  295. You should use the following instead:
  296.  
  297.     QUE IN 5 MINUTES -AT
  298.  
  299. If the command you want to run actually starts with a minus sign, you
  300. also prefix it with another minus sign. To run a command called -HI,
  301. type:
  302.  
  303.     QUE IN 5 MINUTES --HI
  304.  
  305. Typing "QUE" alone gives you a one page help. Some options can be
  306. abbreviated by dropping the lowercase component. For example, the one
  307. page help lists "/Server", which can be abbreviated to "/S".
  308.  
  309. A job scheduled to run at 17:50 does not necessary start exactly at 17:50.
  310. This may be due to other jobs (non-detached ones) also scheduled to run
  311. at the same time that started first. This can also happen when jobs
  312. (non-detached ones) that started before 17:50 have not completed at
  313. 17:50. You need to take this into consideration when you want a
  314. particular job to start exactly at the scheduled time. (If necessary,
  315. you may want to start a 2nd queue.)
  316.  
  317.  
  318. KEYWORD SYNONYMS
  319. ────────────────
  320.  
  321. The following lists QUE keywords in the right-hand column that are
  322. identical to that in the left-hand column. The keywords in the left-hand
  323. column are used in this documentation. Most of the synonym keywords are
  324. merely abbreviations accepted by QUE.
  325.  
  326.     In this text:       Identical to:
  327.     -------------------------------------------------------------
  328.     NEXTDAY             TOMORROW
  329.     HOURS               HR HRS HOUR
  330.     MINUTES             MIN MINS MINUTE
  331.     /SERVER             /S
  332.     /DETACH             /D
  333.     /INSTANCES          /I /INSTANCE
  334.     /LIST               /L
  335.     /VERBOSE            /V
  336.     /QUEUE              /Q
  337.  
  338.  
  339. CONTACTING THE AUTHOR
  340. ─────────────────────
  341.  
  342. If you like to contact me, here's how:
  343.  
  344.     FidoNet:    Lai Zit Seng @ 6:600/200
  345.     Internet:   laizitse@iscs.nus.sg
  346.                 lzs%oconn%csar@jaring.my
  347.     BBS:        Open Connection
  348.                 65-4811345, v.32ter/v.42bis
  349.     Snailmail:  Lai Zit Seng
  350.                 149 Tamarind Road
  351.                 Singapore 2880
  352.                 Republic of Singapore
  353.  
  354. If you have found QUE useful, I'd appreciate a note! Enjoy ;-)
  355.  
  356.  
  357. Lai Zit Seng
  358.  
  359. <end>
  360.  
  361.