home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 11 Util
/
11-Util.zip
/
SCHED02B.ZIP
/
SCHEDULE.DOC
< prev
next >
Wrap
Text File
|
1993-01-05
|
14KB
|
334 lines
Schedule/2 version 0.2 (BETA RELEASE!)
Copyright (c) 1992,1993 by Michael Siebke
LICENSE AGREEMENT:
BECAUSE SCHEDULE/2 IS LICENSED FREE OF CHARGE, I PROVIDE ABSOLUTELY
NO WARRANTY. EXCEPT WHEN OTHERWISE STATED IN WRITING, 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.
IN NO EVENT WILL MICHAEL SIEBKE BE RESPONSIBLE IN ANY WAY FOR THE
BEHAVIOUR OF MODIFIED VERSIONS OF SCHEDULE/2. IN NO EVENT WILL MICHAEL
SIEBKE AND/OR ANY OTHER PARTY WHO MAY MODIFY AND REDISTRIBUTE
SCHEDULE/2 AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY LOST PROFITS, LOST MONIES, OR OTHER SPECIAL,
INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR
INABILITY TO USE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR
DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS) SCHEDULE/2, EVEN IF MICHAEL SIEBKE HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES, OR FOR ANY CLAIM BY ANY OTHER PARTY.
You can contact the author at the fido addresses listed below:
FidoNet: 2:246/8.11 (OS/2 Point Nürnberg, mail only)
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 reached 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.2ß 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 62, default: 31
<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
parameter 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 with an
offset of 31, i.e., if you want to use the standard priority value of 0
you have to set the priority value to 31! This was done to eliminate sign
handling.
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. If the programm which is to be started runs in
VIO mode, the last two modes can be used in addition the the modes just
described. 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, in detached mode, the program is started without creating
a new session. Therefore, all input and output must be handled via
input/output redirection in the last case. 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 results after using the last option was
shown just a few paragraphs above, I'm talking about '-?'.
There are five ways to let Schedule/2 run for you. A program can be
started once at a specific time (AT) or continously 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 continously, 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 (NOTE: YOU MUST SPECIFY THE
FILE EXTENSION, otherwise the file won't be found!). 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 hate writing documentation, I'm sure, I'm not
the only one... Anyway, 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 each day, using the
server priority class (you won't go to lunch too late :-), use the
following command:
SCHEDULE -ps AT 12:00 -nmf : 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' each day.
If you are very hungry ;-), you may start 'LunchBeep' every second hour.
In that case, you should enter:
SCHEDULE -ps AFTER 2:00 -nmf : LunchBeep.Exe
In the case of a run-through system, use 'REPEAT' instead of 'AFTER'. In
both examples '-mf' is used to start 'LunchBeep' in the foreground! Since
LunchBeep is an EXE-file, there is no need to start an extra shell (-n).
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 (minus 2 in relation to the standard
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 -p29 -qmd EVERY 18:00 : SaveCfg
DETACH SCHEDULE -p29 -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 - good
night... To avoid this and to have a sound sleep, you can 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 comes night 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 -pt62 -ms AT 06:55 : Shutdown.Cmd
Please note the 'pt62' 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... I put the final
version into some well known OS/2 BBS in germany at the time I'm quiet
sure, that there is no bug left.
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.
January 1993,
Michael