home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Der Mediaplex Sampler - Die 6 von Plex
/
6_v_plex.zip
/
6_v_plex
/
DISK6
/
OS_13
/
SCHED03B.ZIP
/
SCHEDULE.DOC
< prev
next >
Wrap
Text File
|
1993-05-28
|
13KB
|
319 lines
Schedule/2 version 0.3 (BETA RELEASE!)
Copyright (c) 1992,1993 by Michael Siebke
LICENSE AGREEMENT:
BECAUSE SCHEDULE/2 IS LICENSED FREE OF CHARGE, I PROVIDE ABSOLUTELY NO
WARRANTY. I PROVIDE SCHEDULE/2 "AS IS" WITHOUT WARRANTY OF ANY KIND,
EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF SCHEDULE/2, AND
THE ACCURACY OF ITS ASSOCIATED DOCUMENTATION, IS WITH YOU.
SHOULD SCHEDULE/2 OR ITS ASSOCIATED DOCUMENTATION PROVE DEFECTIVE,
YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
You can contact the author at the fido addresses listed below:
FidoNet: 2:246/999 (Portals of Brunswick, 18:00 - 06:00)
21:100/9898 (BBS: 18:00 - 02:00)
Surface mail:
Schultheißallee 53
8500 Nürnberg 30
Germany
I can usually be reached through the EchoMail conferences called
OS2PROG (OS/2 programming) and OS2.PROG.GER (german echo). Since
I'm a member of the DAP, you can reach me through an DAP internal
echo, too.
Sending correspondence via electronic mail is strongly preferred.
However, if you expect to receive a reply via surface mail,
please enclose a self-addressed, stamped envelope. Users
outside of Germany should include an international postal reply
coupon instead of a stamp.
DO NOT ATTEMPT TO CONTACT THE AUTHOR BY TELEPHONE!
VOICE SUPPORT WILL NOT BE PROVIDED!
Please feel free to contact the author at any time to share your
comments about this software and/or licensing policies.
In true multitasking systems like OS/2 it's often desirable to start
programs at specific times. OS/2 users will find a tool named PMDALARM,
delivered in the OS/2 2.0 SE package, which desires these requests. That
tool can be used to popup messages and to start programs, but it won't
work in cases, where no presentation manager is available. Schedule/2 was
written to meet these wishes even in that cases. Since Schedule/2 won't
use the presentation manager, the user interface is not as comfortable as
it were if using a graphical interface. All options and time definitions
must be done in the command line, nevertheless (or just for that reason
:-), it is very simple to use and fulfils most demands for such a tool,
at least I hope so.
If you call Schedule/2 with the help option set (-?), a smart help screen
will be displayed:
[D:\] Schedule -?
Schedule/2 0.3 for OS/2 2.x, Copyright (c) 1992,1993 by Michael Siebke
This is free software, use and enjoy it. All rights reserved!
SCHEDULE [options] AT [day [,day(s)] ] time : <command>
SCHEDULE [options] EVERY [day [,day(s)] ] time : <command>
SCHEDULE [options] AFTER difftime : <command>
SCHEDULE [options] REPEAT difftime : <command>
SCHEDULE [options] : <command>
Options: -p<c><no> Use priority class <c> with value <no>
-m<m> Run command in <m> mode
-c Check command line parsing
-n Don't load shell for execution
-q No logo display
-? Display this text
day = { Mon | Tue | Wed | Thu | Fri | Sat | Sun }
time = [HH:]MM[.SS]
<c> = (I)dle, (N)ormal, (S)erver or (T)imecritical
<no> = Priority value between 0 and 31, default: 0
<m> = (F)oreground, (B)ackground, (S)ynchronous, (D)etached
e.g.: SCHEDULE AT -qmb Mon, Wed, Fri 6:30 : POINT.CMD
SCHEDULE -pt -md AFTER 1:00 : Shutdown.Cmd
SCHEDULE EVERY Fri 15:00 -nmf : Weekend.Exe
SCHEDULE REPEAT -ms -p10 0:10 : FileStat.Cmd
[D:\]
The command line options are devided into two groups: The first group
specifies anything, which is used by Schedule/2 to perform the desired
function, i.e. to start a program at a specific time. In detail, the first
group contains all parameters up to the colon, which is used as a
delimiter. The second group contains the command string, including
parameters for the program, which is to be started.
There are six options, which can be used anywhere but before the colon.
The priority can be set by using the '-p' option. The priority class can
be specified as well as the priority value itself. It is valid to specify
only the class or the value, if both are specified, the class must be
given first! Please note, that the priority value must be given absolutely
and not as a delta value for the current priority settings. If you want
to set the priority value to "5", you must specify "5" independent of the
priority value currently set. This may be somehow different from other
tools, where a delta value is used, which gives the difference between
the current value and the desired one.
The execution mode, in which the program is to be started, may be
specified by using the '-m' option. Four modes are available, I hope these
modes will fulfil all possible requirements for starting a program by
Schedule/2. The first mode (Foreground) is used to create a new session in
the foreground. This implies, that the session, which was in the
foreground at the time Schedule/2 started the program, is switched to the
background. Most often, this is not welcome. In that case, the second mode
(Background) should be used, which will do the same but starting the
session in the background. In synchronous mode, Schedule/2 is stopped during
execution of the program and the output of the program is displayed in the
same session Schedule/2 runs. The detached mode may by used for PM applica-
tiosn or for programs, where all input and output is handled via input/out-
put redirection.
Please note, that you MUST use the synchronous or detached mode, if you want
to run the program with a special priority, given by the "-p" option!
Usually, Schedule/2 will load a shell (specified by the environment
variable 'OS2_SHELL' or, if not defined, CMD.EXE) to execute the
desired command. If there is no need for an extra shell (e.g., if you
start an EXE-file directly), you can force Schedule/2 to start the
command directly by giving the '-n' in the command line. In that case,
you must specify the extension of the file to be started, otherwise
OS/2 won't be able to start it!
The '-c' option is implemented mainly for debug purposes. You can use it
to check, if the command line parameters are parsed by Schedule/2 in a
way you thought. The second to the last option is used to disable the logo
output of Schedule/2 (-q). The last option (-?) may be used to display the
smart help screen shown above.
There are five ways to let Schedule/2 run for you. A program can be
started once at a specific time (AT) or continuously at specific times
(EVERY). In both cases the execution can be limited to one or more week
days, if you want. If you want to run the program not at a specific time
but after a given delay (e.g. 10 minutes after starting Schedule/2), you
may use the keywords 'AFTER' or 'REPEAT'. The first one will start the
program once, the last one will start the program continuously, each time
the given delay has past. I show some examples at the end. The fifth
mode will start a program directly without waiting for a specified time.
This mode should be used if a program should be immediatly run but with
a individual priority.
Week days must be given be a three letter abbreviation; Mon for Monday,
Tue for Tuesday, and so on. Time specifications in the case of using the
'AFTER' or 'REPEAT' keyword must not include a week day specification, it
wouldn't make sense. The specified time can be given in hours, minutes
and seconds. The minutes value is a must, hours and seconds can be left
out, in that case they will be substituted with 0. The delimiter between
hours and minutes is a colon, the delimter between minutes and seconds
is a point! This is used to determine, wether a hour and minutes
specification is given (e.g. 02:30) or a minutes and seconds specification
(e.g. 02.30).
After all, a colon must be entered followed by the complete command line
which should be executed at the proper time. Please have in mind, that
the OS/2 command processor makes a preprocessing of the command line
parameters before Schedule/2 becomes access to them. In some cases (e.g.
if you need more than one space between alphanumeric letters, you have to
use '"' chars to avoid any processing by the command processor). Please
refer to the online reference for more information about this. Usually,
any command line parameters can be specified without '"' chars.
This should be enough. I hope the following examples makes it clear
enough how to use Schedule/2 for your purposes.
Examples:
To start the PM application 'LunchBeep' at 12:00 every day, using the
server priority class (you won't go to lunch too late ;-), use the
following command:
SCHEDULE -ps AT 12:00 -n : LunchBeep.Exe
If your PC is running non-stop through the week, you should use EVERY
instead of AT, which causes Schedule/2 to start 'LunchBeep' every day.
If you know, that you will be hungry in 2 hours, you may enter:
SCHEDULE -ps AFTER 2:00 -n : LunchBeep.Exe
If you are always hungry after 2 hours, you should use 'REPEAT' instead
of 'AFTER'. Since LunchBeep is an EXE-file, there is no need to start
an extra shell (-n). It may be necessary, to specifiy the complete path
to LunchBeep.
Let us assume, you want to save all configuration files of some
applications in a separate directory and you have written a script file
called 'SaveCfg.Cmd' to do this. You want to execute this script file each
day in the afternoon, whereby the script file requires no input. Each
wednesday and each sunday, the script file 'Bkp' should be executed, which
performs a full backup of your configuration directory. Both script files
should be run with lower priority to reduce any influence to the performance
of your system. The first script makes no output to the screen, the output
of the second script should be written to a log file. You can include the
following two lines in your STARTUP.CMD to perform an automatic backup as
described:
DETACH SCHEDULE -pi20 -qmd EVERY 18:00 : SaveCfg
DETACH SCHEDULE -pi20 -qmd EVERY Wed,Sun 19:00 : Bkp.Cmd ">log"
You can also include the commands into your CONFIG.SYS, but don't forget
to substitute the DETACH's with RUN's. Please note, that you don't have
to specify the extension of a script file (e.g. SaveCfg), if the script
file is placed in a directory contained in your path variable.
Last example: Imagine, you are point of the fidonet. Each morning, your PC
will be switched on at (e.g.) 06:20 to poll your boss for new mail. At
07:00 the PC will be switched off automatically. Now thinking about what
will happen if the mail processor is still packing your mail at the time
the PC will be switched off. If you have your write cache enabled - have
a good night... To avoid this (and to have a sound sleep), you may start
5 minutes before the PC will be switched off a shutdown script, which will
stop your mail processor, flush your disk cache and perform the shutdown
function before it's getting dark for your system! Writing this batch file
will not be explained here, but if you ask for the corresponding Schedule/2
command, here it is:
DETACH SCHEDULE -pt31 -ms AT 06:55 : Shutdown.Cmd
Please note the 'pt31' option, it gives your shutdown script the highest
priority which can be given to any program. Having in mind, that your mail
processor is running at normal priority, you can be sure, that your
shutdown is completed before the power has gone!
By the way, if you want to run BinkleyTerm with server priority, I prefer
to use the following syntax:
SCHEDULE -ps -nqms : BTP.EXE Share Unattended
(Includes: Server priority, no extra shell, quiet mode, synchronous mode)
Ok, some additional notes at the end. Schedule/2 is a true 32 bit program,
therefore there is no possibility to run it on OS/2 1.x. If there are any
demands for a 16 bit version, it should be no problem to recompile it -
all I need is a 16 bit compiler, at least for about 5 minutes ;-).
Schedule/2 can handle long filenames, no question; the script filenames in
the smart help display of Schedule/2 are not only imagination.
If there are any demands you are missing in this version of Schedule/2,
please feel free to contact me at one of the addresses as stated above.
Mail via FidoNet is recommended. The same applies to bug reports.
AND DON'T FORGET: This is a BETA version! Bug reports of any kind are
welcome, nevertheless I hope, there is no bug left... The latest version
of SCHEDULE may be requested via the SCHEDULE magic at 2:246/999.
Although Schedule/2 is free of charge, I'm happy about any response I
get from you, wether it is a small fee or only a short mail.
May 1993,
Michael