home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / SCHED02B.ZIP / SCHEDULE.DOC < prev    next >
Text File  |  1993-01-05  |  14KB  |  334 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.                                    Schedule/2 version 0.2 (BETA RELEASE!)
  51.                                                                           
  52.                                 Copyright (c) 1992,1993 by Michael Siebke
  53.  
  54. LICENSE AGREEMENT:
  55.  
  56. BECAUSE SCHEDULE/2 IS LICENSED FREE OF CHARGE, I PROVIDE ABSOLUTELY
  57. NO WARRANTY.  EXCEPT WHEN OTHERWISE STATED IN WRITING, I PROVIDE
  58. SCHEDULE/2 "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
  59. OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  60. OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
  61. ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF SCHEDULE/2, AND
  62. THE ACCURACY OF ITS ASSOCIATED DOCUMENTATION, IS WITH YOU.
  63. SHOULD SCHEDULE/2 OR ITS ASSOCIATED DOCUMENTATION PROVE DEFECTIVE,
  64. YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
  65.  
  66. IN NO EVENT WILL MICHAEL SIEBKE BE RESPONSIBLE IN ANY WAY FOR THE
  67. BEHAVIOUR OF MODIFIED VERSIONS OF SCHEDULE/2. IN NO EVENT WILL MICHAEL
  68. SIEBKE AND/OR ANY OTHER PARTY WHO MAY MODIFY AND REDISTRIBUTE
  69. SCHEDULE/2 AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
  70. INCLUDING ANY LOST PROFITS, LOST MONIES, OR OTHER SPECIAL,
  71. INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR
  72. INABILITY TO USE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR
  73. DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY THIRD
  74. PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
  75. PROGRAMS) SCHEDULE/2, EVEN IF MICHAEL SIEBKE HAS BEEN ADVISED OF THE
  76. POSSIBILITY OF SUCH DAMAGES, OR FOR ANY CLAIM BY ANY OTHER PARTY.
  77.  
  78.  
  79. You can contact the author at the fido addresses listed below:
  80.  
  81. FidoNet:    2:246/8.11 (OS/2 Point Nürnberg, mail only)
  82.  
  83. Surface mail:
  84.  
  85. Schultheißallee 53
  86. 8500 Nürnberg 30
  87. Germany
  88.  
  89. I can usually be reached through the EchoMail conferences called
  90. OS2PROG (OS/2 programming) and OS2.PROG.GER (german echo). Since
  91. I'm a member of the DAP, you can reached me through an DAP
  92. internal echo, too.
  93.  
  94. Sending correspondence via electronic mail is strongly preferred.
  95. However, if you expect to receive a reply via surface mail,
  96. please enclose a self-addressed, stamped envelope.  Users
  97. outside of Germany should include an international postal reply
  98. coupon instead of a stamp.
  99.  
  100. DO NOT ATTEMPT TO CONTACT THE AUTHOR BY TELEPHONE!
  101. VOICE SUPPORT WILL NOT BE PROVIDED!
  102.  
  103. Please feel free to contact the author at any time to share your
  104. comments about this software and/or licensing policies.
  105.  
  106. In true multitasking systems like OS/2 it's often desirable to start
  107. programs at specific times. OS/2 users will find a tool named PMDALARM,
  108. delivered in the OS/2 2.0 SE package, which desires these requests. That
  109. tool can be used to popup messages and to start programs, but it won't
  110. work in cases, where no presentation manager is available. Schedule/2 was
  111. written to meet these wishes even in that cases. Since Schedule/2 won't
  112. use the presentation manager, the user interface is not as comfortable as
  113. it were if using a graphical interface. All options and time definitions
  114. must be done in the command line, nevertheless (or just for that reason
  115. :-), it is very simple to use and fulfils most demands for such a tool,
  116. at least I hope so.
  117.  
  118. If you call Schedule/2 with the help option set (-?), a smart help screen
  119. will be displayed:
  120.  
  121.  
  122. [D:\] Schedule -?
  123.  
  124. Schedule/2 0.2ß for OS/2 2.x, Copyright (c) 1992,1993 by Michael Siebke
  125. This is free software, use and enjoy it. All rights reserved!
  126.  
  127. SCHEDULE [options] AT      [day [,day(s)] ] time : <command>
  128. SCHEDULE [options] EVERY   [day [,day(s)] ] time : <command>
  129.  
  130. SCHEDULE [options] AFTER   difftime : <command>
  131. SCHEDULE [options] REPEAT  difftime : <command>
  132.  
  133. SCHEDULE [options] : <command>
  134.  
  135. Options: -p<c><no>   Use priority class <c> with value <no>
  136.          -m<m>       Run command in <m> mode
  137.          -c          Check command line parsing
  138.          -n          Don't load shell for execution
  139.          -q          No logo display
  140.          -?          Display this text
  141.  
  142. day  = { Mon | Tue | Wed | Thu | Fri | Sat | Sun }
  143. time = [HH:]MM[.SS]
  144.  
  145. <c>  = (I)dle, (N)ormal, (S)erver or (T)imecritical
  146. <no> = Priority value between 0 and 62, default: 31
  147. <m>  = (F)oreground, (B)ackground, (S)ynchronous, (D)etached
  148.  
  149. e.g.:  SCHEDULE AT -qmb Mon, Wed, Fri 6:30 : POINT.CMD
  150.        SCHEDULE -pt -md AFTER 1:00  : Shutdown.Cmd
  151.        SCHEDULE EVERY Fri 15:00 -nmf : Weekend.Exe
  152.        SCHEDULE REPEAT -ms -p10 0:10 : FileStat.Cmd
  153.  
  154. [D:\]
  155.  
  156.  
  157. The command line options are devided into two groups: The first group
  158. specifies anything, which is used by Schedule/2 to perform the desired
  159. function, i.e. to start a program at a specific time. In detail, the first
  160. group contains all parameters up to the colon, which is used as a
  161. delimiter. The second group contains the command string, including
  162. parameter for the program, which is to be started.
  163.  
  164. There are six options, which can be used anywhere but before the colon.
  165. The priority can be set by using the '-p' option. The priority class can
  166. be specified as well as the priority value itself. It is valid to specify
  167. only the class or the value, if both are specified, the class must be
  168. given first! Please note, that the priority value must be given with an
  169. offset of 31, i.e., if you want to use the standard priority value of 0
  170. you have to set the priority value to 31! This was done to eliminate sign
  171. handling.
  172.  
  173. The execution mode, in which the program is to be started, may be
  174. specified by using the '-m' option. Four modes are available, I hope these
  175. modes will fulfil all possible requirements for starting a program by
  176. Schedule/2. The first mode (Foreground) is used to create a new session in
  177. the foreground. This implies, that the session, which was in the
  178. foreground at the time Schedule/2 started the program, is switched to the
  179. background. Most often, this is not welcome. In that case, the second mode
  180. (Background) should be used, which will do the same but starting the
  181. session in the background. If the programm which is to be started runs in
  182. VIO mode, the last two modes can be used in addition the the modes just
  183. described. In synchronous mode, Schedule/2 is stopped during execution of
  184. the program and the output of the program is displayed in the same session
  185. Schedule/2 runs, in detached mode, the program is started without creating
  186. a new session. Therefore, all input and output must be handled via
  187. input/output redirection in the last case. Please note, that you MUST use
  188. the synchronous or detached mode, if you want to run the program with
  189. a special priority, given by the "-p" option!
  190.  
  191. Usually, Schedule/2 will load a shell (specified by the environment
  192. variable 'OS2_SHELL' or, if not defined, CMD.EXE) to execute the
  193. desired command. If there is no need for an extra shell (e.g., if you
  194. start an EXE-file directly), you can force Schedule/2 to start the
  195. command directly by giving the '-n' in the command line. In that case,
  196. you must specify the extension of the file to be started, otherwise
  197. OS/2 won't be able to start it!
  198.  
  199. The '-c' option is implemented mainly for debug purposes. You can use it
  200. to check, if the command line parameters are parsed by Schedule/2 in a
  201. way you thought. The second to the last option is used to disable the logo
  202. output of Schedule/2 (-q). The results after using the last option was
  203. shown just a few paragraphs above, I'm talking about '-?'.
  204.  
  205. There are five ways to let Schedule/2 run for you. A program can be
  206. started once at a specific time (AT) or continously at specific times
  207. (EVERY). In both cases the execution can be limited to one or more week
  208. days, if you want. If you want to run the program not at a specific time
  209. but after a given delay (e.g. 10 minutes after starting Schedule/2), you
  210. may use the keywords 'AFTER' or 'REPEAT'. The first one will start the
  211. program once, the last one will start the program continously, each time
  212. the given delay has past. I show some examples at the end. The fifth
  213. mode will start a program directly without waiting for a specified time.
  214. This mode should be used if a program should be immediatly run but with
  215. a individual priority.
  216.  
  217. Week days must be given be a three letter abbreviation; Mon for Monday,
  218. Tue for Tuesday, and so on. Time specifications in the case of using the
  219. 'AFTER' or 'REPEAT' keyword must not include a week day specification, it
  220. wouldn't make sense. The specified time can be given in hours, minutes
  221. and seconds. The minutes value is a must, hours and seconds can be left
  222. out, in that case they will be substituted with 0. The delimiter between
  223.  
  224. hours and minutes is a colon, the delimter between minutes and seconds
  225. is a point! This is used to determine, wether a hour and minutes
  226. specification is given (e.g. 02:30) or a minutes and seconds specification
  227. (e.g. 02.30).
  228.  
  229. After all, a colon must be entered followed by the complete command line
  230. which should be executed at the proper time (NOTE: YOU MUST SPECIFY THE
  231. FILE EXTENSION, otherwise the file won't be found!). Please have in mind,
  232. that the OS/2 command processor makes a preprocessing of the command line
  233. parameters before Schedule/2 becomes access to them. In some cases (e.g.
  234. if you need more than one space between alphanumeric letters, you have to
  235. use '"' chars to avoid any processing by the command processor). Please
  236. refer to the online reference for more information about this. Usually,
  237. any command line parameters can be specified without '"' chars.
  238.  
  239. This should be enough - I hate writing documentation, I'm sure, I'm not
  240. the only one... Anyway, I hope the following examples makes it clear
  241. enough how to use Schedule/2 for your purposes.
  242.  
  243. Examples:
  244.  
  245. To start the PM application 'LunchBeep' at 12:00 each day, using the
  246. server priority class (you won't go to lunch too late :-), use the
  247. following command:
  248.  
  249. SCHEDULE -ps AT 12:00 -nmf : LunchBeep.Exe
  250.  
  251. If your PC is running non-stop through the week, you should use EVERY
  252. instead of AT, which causes Schedule/2 to start 'LunchBeep' each day.
  253.  
  254. If you are very hungry ;-), you may start 'LunchBeep' every second hour.
  255. In that case, you should enter:
  256.  
  257. SCHEDULE -ps AFTER 2:00 -nmf : LunchBeep.Exe
  258.  
  259. In the case of a run-through system, use 'REPEAT' instead of 'AFTER'. In
  260. both examples '-mf' is used to start 'LunchBeep' in the foreground! Since
  261. LunchBeep is an EXE-file, there is no need to start an extra shell (-n).
  262.  
  263. Let us assume, you want to save all configuration files of some
  264. applications in a separate directory and you have written a script file
  265. called 'SaveCfg.Cmd' to do this. You want to execute this script file each
  266. day in the afternoon, whereby the script file requires no input. Each
  267. wednesday and each sunday, the script file 'Bkp' should be executed, which
  268. performs a full backup of your configuration directory.  Both script files
  269. should be run with lower priority (minus 2 in relation to the standard
  270. priority) to reduce any influence to the performance of your system. The
  271. first script makes no output to the screen, the output of the second
  272. script should be written to a log file. You can include the following two
  273. lines in your STARTUP.CMD to perform an automatic backup as described:
  274.  
  275. DETACH SCHEDULE -p29 -qmd EVERY 18:00 : SaveCfg
  276. DETACH SCHEDULE -p29 -qmd EVERY Wed,Sun 19:00 : Bkp.Cmd ">log"
  277.  
  278. You can also include the commands into your CONFIG.SYS, but don't forget
  279. to substitute the DETACH's with RUN's. Please note, that you don't have
  280. to specify the extension of a script file (e.g. SaveCfg), if the script
  281. file is placed in a directory contained in your path variable.
  282.  
  283. Last example: Imagine, you are point of the fidonet. Each morning, your PC
  284. will be switched on at, e.g., 06:20 to poll your boss for new mail. At
  285. 07:00 the PC will be switched off automatically. Now thinking about what
  286. will happen if the mail processor is still packing your mail at the time
  287. the PC will be switched off. If you have your write cache enabled - good
  288. night... To avoid this and to have a sound sleep, you can start 5 minutes
  289. before the PC will be switched off a shutdown script, which will stop your
  290. mail processor, flush your disk cache and perform the shutdown function
  291. before it comes night for your system! Writing this batch file will not be
  292. explained here, but if you ask for the corresponding Schedule/2 command,
  293. here it is:
  294.  
  295. DETACH SCHEDULE -pt62 -ms AT 06:55 : Shutdown.Cmd
  296.  
  297. Please note the 'pt62' option, it gives your shutdown script the highest
  298. priority which can be given to any program. Having in mind, that your mail
  299. processor is running at normal priority, you can be sure, that your
  300. shutdown is completed before the power has gone!
  301.  
  302. By the way, if you want to run BinkleyTerm with server priority, I prefer
  303. to use the following syntax:
  304.  
  305. SCHEDULE -ps -nqms : BTP.EXE Share Unattended
  306.  
  307. (Includes: Server priority, no extra shell, quiet mode, synchronous mode)
  308.  
  309.  
  310. Ok, some additional notes at the end. Schedule/2 is a true 32 bit program,
  311. therefore there is no possibility to run it on OS/2 1.x. If there are any
  312. demands for a 16 bit version, it should be no problem to recompile it -
  313. all I need is a 16 bit compiler, at least for about 5 minutes ;-).
  314. Schedule/2 can handle long filenames, no question; the script filenames in
  315. the smart help display of Schedule/2 are not only imagination.
  316.  
  317. If there are any demands you are missing in this version of Schedule/2,
  318. please feel free to contact me at one of the addresses as stated above.
  319. Mail via FidoNet is recommended. The same applies to bug reports.
  320.  
  321. AND DON'T FORGET: This is a BETA version! Bug reports of any kind are
  322. welcome, nevertheless I hope, there is no bug left... I put the final
  323. version into some well known OS/2 BBS in germany at the time I'm quiet
  324. sure, that there is no bug left.
  325.  
  326. Although Schedule/2 is free of charge, I'm happy about any response I
  327. get from you, wether it is a small fee or only a short mail.
  328.  
  329.  
  330. January 1993,
  331.  
  332. Michael
  333.  
  334.