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