home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Black Box 4
/
BlackBox.cdr
/
lan
/
cron24.arj
/
MANUAL.DOC
< prev
next >
Wrap
Text File
|
1991-05-29
|
18KB
|
442 lines
CRONJR
By
Software Shorts
Thank you for retrieving CRONJR. This is a full working
copy of CRONJR. The only difference between the evaluation
copy and the one you pay for is that the one you pay for does
not display the blinking green "evaluation" line and it does
not play the two bars of the USC fight song upon loading and
launching. If you are still using this program after the
two week evaluation period, please pay the required
registration fee of $45.00.
Requirements
------------
MS-DOS based machine running MS-DOS 3.30 or higher.
MS-DOS versions below 3.30 may be used, but are not
recommended, since they require CRONJR to use more memory.
Background
----------
The reason for designing CRONJR was for lack of anything
better in the MS-DOS world. Simple but powerful programs
like cron (part of AT&T's Unix) or Sleeper (public domain
for HP's MPE) are non existent for PC's.
With more and more companies moving from mini-computers
to PC based LANs, one of the many things that has been lost
was the ability to schedule the nightly reporting and
maintenance programs needed to keep a business working during
the day.
Sure, it's possible to just write a large batch file
that will run all your programs one after another. That
solution is fine if it meets your needs. But if you need
programs to run at specific times, and especially if your
business revolves around a LAN, then this product is for you.
The solution
------------
There are 3 methods of scheduler implementation in a DOS
environment.
Method 1
Make a background RAM resident program that will
pop up when it is time to run the tasks.
Method 2
Make a foreground program that loads the tasks as
child processes.
Method 3
Make a transient program that is only in memory
when it is needed. Therefore, all memory is
available for the task.
Faults for method 1
--------------------
The last thing the world needs is another RAM
resident program to eat up memory, steal clock
cycles, and substitute custom interrupt vectors. Most
LAN users already use 20-70k for their network shell,
and even more if they are running a NETBIOS emulator.
The way most resident schedulers work is to stuff the
keyboard when it is time to execute a task. This
method can be seen in various automatic tape backup
programs. This method is unreliable since the assumption
is made that the DOS prompt is available, the command
line is clear, and the path is set.
Faults for method 2
-------------------
This method requires too much memory. If you want to
run a batch file then you have to load another version
of COMMAND.COM on top of the parent scheduler.
Why method 3 is so swell
------------------------
1. It is so simple. It relies heavily on two simple
operating system level batch files.
2. It is not RAM resident so it uses no memory(*).
* The dreaded asterisk - If you are using a DOS
version below 3.3 then around 23k is lost because
COMMAND.COM needs to be invoked a second time.
It is strongly recommend that DOS 3.30 or above is
used.
How it works
------------
1. The schedule file CRONJR.SCH is created by you. It
contains the timing parameters for the tasks to be executed.
2. The master batch file, CRONJR.BAT, is loaded from the
command line. That is your last intervention.
3. The work file, CRONWK.BAT, is deleted by CRONJR.BAT.
4. The scheduler program, CRON.EXE, is loaded and the
schedule file CRONJR.SCH is read.
5. When the time comes to execute a process CRON.EXE
dumps its scheduling information to CRONJR.JOB, writes the
CRONWK.BAT bat file and unloads from memory to return control
to CRONJR.BAT.
6. If CRONJR.BAT can find CRONWK.BAT then the CRONWK.BAT
work file is called/executed.
7. Upon completion of CRONWK.BAT, control is returned to
CRONJR.BAT which then executes CRONJR.BAT (thus ending the
original CRONJR.BAT execution) with the parameter RELOAD
which is passed to CRON.EXE in step 4, which causes the file
CRONJR.JOB to be loaded rather than the file CRONJR.SCH .
Hard to follow? Try this one. It is the remedial
version.
CRONJR.BAT -> CRON.EXE -> CRONWK.BAT (YOUR TASK) ->CRONJR.BAT
A. B. C. A.
Installation
------------
Create a directory for CRONJR, any name will do, and
copy the CRON.EXE program into the new directory. If you are
going to use CRONJR on a LAN with multiple machines running
CRONJR, then you must make a separate directory for each
machine.
Examples:
F:\CRON\386
F:\BOB\CRON
F:\CRON\486
F:\ACCTNG\CRON
Each directory must contain its own CRONJR.SCH file and
its own unique CRONJR.BAT file. A path may be set to point
to the location of CRON.EXE.
For each CRONJR directory created, type CRON START at
their respective DOS prompt. Such as:
F:\CRON\386>cron start
This will create the CRONJR.BAT file which is specific
to its home directory. If you type out the CRONJR.BAT file
you will understand.
Create a flat ASCII file (no tabs) named CRONJR.SCH or
edit the one on the distribution diskette. Enter one task
per line using the following format.
minute hour day_of_month month day_of_week executable parm_list
Example
-------
50 16 * * MOTUWETHFR f:\public\bin\killuser.EXE
0 17 * * MOTUWETHFR f:\mtn_tape\databack.bat
0 5 * * MO g:\acctng\weekly.bat
0 1 1 * SUMOTUWETHFRSA G:\ACCTNG\MONTHEND.EXE
0 1 1 1 SUMOTUWETHFRSA G:\ACCTNG\YEARLY.EXE
49 16 * * MOTUWETHFR C:\FUNNY\GOHOME.EXE
2i * * * MOTUWETHFR F:\stream\kevin.bat
* 1i * * MOTUWETHFR q:\hourly\bak2work.exe
30 12 * * WE nopath.com
06 30 * * SA u:\palitape\tna2tape.exe /a q /optic
Type CRONJR at the DOS prompt and you are finished.
Field definitions
-----------------
minute......: the minute of the hour you want your
schedule to execute, 0 through 59.
hour........: the hour of the day in military time,
0 through 23.
day_of_month: the day of the month 1 through 31.
month.......: the month of the year 1 through 12.
day_of_week.: the day of the week, SU MO TU WE TH FR SA.
executable..: a DOS executable string, .BAT, .EXE, and
.COM files with a maximum combined path of
64 characters. EXTENTIONS MUST BE USED!!!!!!
parm_list...: optional parameters to be passed to the executable.
Maximum of 128 characters.
Wild cards and increments
-------------------------
*: execute on every occurrence - not used by day_of_week .
i: execute in increments - only applies to minute and
hour. The 7th line in the example shows 2i which
means execute in 2 minute increments. In theory this
task could be executed 30 times a hour. Obviously *
must be used for every level after the first i .
Combinations of i in the minute and hour are not
allowed. The expected outcome is that only the
hour increment will be used. If 'i' is used with the
hour, then the minute should be *, otherwise
execution will occur in x hour increments, but only
on the specified minute. Thus 30 1i does not mean
execute every 90 minutes, but execute hourly on the
30th minute of the hour.
Launch time
-----------
Task checking and launching occur on the 1st second of
the minute.
EXTREMELY IMPORTANT
-------------------
Be very careful when assigning launch times. A 'feature'
of CRONJR is that it only launches tasks when CRON.EXE is
resident. Example: you have 2 tasks set to execute at 19:00,
each takes 20 minutes to run, and few tasks scheduled at
19:15. At 19:00 all 19:00 tasks are tagged for launching and
the first task will be launched at 19:00. The 2nd task will
be launched when CRON.EXE is reloaded and thus effectively
launched at 19:20.
Well it is now 19:40 and all tasks scheduled from 19:01
through 19:40 have missed their launch window.
To prevent this from happening you should do the
following. Schedule enough time between tasks. The 19:15
tasks in the example should have been set later to 20:00, or
earlier to 19:00. Had they been scheduled at 19:00 then they
would have run as part of the 19:00 launching.
Proper scheduling
-----------------
The best way to debug a faulty schedule is to run
CRON.EXE instead of CRONJR.BAT, and use the F1 key to exit to
DOS and change the time. Inspect the CRONWK.BAT file that is
created.
There is no limit to the number of tasks you can put
into the CRONJR.SCH file.
Common problems
---------------
CRONJR program is running, and exits to DOS and does nothing.
Problem: Running CRON instead of CRONJR.
Problem: Did not run CRON START in the execution directory.
CRONJR does not execute the programs listed in CRONJR.SCH
Problem: Could not find the programs. Need to specify the
path in the CRONJR.SCH file or set a DOS path.
Problem: You did not specify .BAT, .EXE, or .COM .
Problem: Your scheduling parameters are incorrect. Most
likely day_of_the_week not included. I.e. You
are testing on Saturday a job you have set up
to run Monday through Friday.
CRONJR playes this obnoxious fight song when it executes.
Problem: Running the evaluation version.
The competition
---------------
It was mentioned earlier that there are no programs
available similar to CRONJR. Well that is no longer true.
There is product called PS-Batch from Brightwork Development.
Its list price is around $595.00, it must be licensed per
file server, it uses about 40k of memory and it is limited
to Netware. CRONJR on the other hand is available for
$45.00, licensing is per site - not batch station or server,
it uses 0k of memory and will work on ANY LAN or stand alone
PC.
I am sure PS-Batch is a fine product and has many more
features than CRONJR. Many of these features were purposely
designed out of the original versions of CRONJR.
Anomalies and hints
-------------------
There are two known anomalies and one other point that you
need to remember.
Anomaly 1. Cronjr only executes tasks on the 1st second
of the minute. Example. If you had 3 tasks that each take 5
seconds to complete, and they are all scheduled to launch at
19:00 then they will be effectively launched at 19:00, 19:01
and 19:02. This feature was designed into the product.
Anomaly 2. Anomaly 2 arises out of anomaly 1. Example.
If you set up a schedule that has 3 jobs, each set to run in
increments of 10 minutes (10i * * * ...), you would assume
that they would execute at the 10, 20, 30, 40, 50, 00 minute
clock demarcations (assuming that the first launch minute was
hh:00) and always launch one after the other. In reality this
is not true.
The first launching schedule would look like this.
1a. Job #1 launches at the first available minute.
2a. Job #2 launches at the first available minute
after Job #1 completes.
3a. Job #3 launches at first available minute after Job
#2 completes.
The second and subsequent launchings might look like
this.
1b. Job #1 launches 10 minutes after its's first
launching or at the first available minute after
Job #3 finishes or it may launch the first available
minute after Job #1 if Job #1 takes more than 10
minutes.
2b. and 3b. Who knows.
The best way to get around this confusion is to do one
of three things.
1. Carefully plan and test your incremental launchings.
2. Rather than make your launchings incremental, make
them minute specific. This may involve multiple line entries
into the CRONJR.SCH file for he same job at different times.
3. Make Jobs 1, 2 and 3 one job.
The one thing you must remember. The CRONJR.SCH file is
only loaded at the initial load time. If you are running
CRONJR on a LAN and CRONJR is running on a remote machine and
you modify the remote machine's CRONJR.SCH file, the remote
CRONJR will not reflect any of the changes made in the new
CRONJR.SCH file until the remote CRONJR is aborted and
reloaded.
Getting legal
-------------
Software Shorts hereby disclaims all warranties relating
to this software, whether expressed or implied, including
without limitation any implied warranties of merchantability
or fitness for a particular purpose. Software Shorts will
not be liable for any special, incidental, consequential,
indirect or similar damages due to loss of data or any other
reason, even if Software Shorts or an agent of Software
Shorts has been advised of the possibility of such damages.
Software Shorts will not be liable for any damages due to
malicious third party augmentation of the executable program.
In no event shall Software Shorts's liability for any damages
ever exceed the price paid for the license to use software,
regardless of the form of the claim. The person using the
software bears all risk as to the quality and performance of
the software.
Acknowledgements
----------------
Unix, cron and AT&T are registered trademarks of American
Telephone and Telegraph Corporation.
MPE and HP are copyrights of Hewlett Packard Company.
Sleeper is available through INTEREX
MS-DOS is a registered trademarks of Microsoft Corporation.
NetWare is a registered trademark of Novell Incorporated
PS-Batch is a trademark of Brightwork Development Incorporated
Software Shorts is not affiliated with any of the above
mentioned companies.
One last word
-------------
Software Shorts is dedicated to the creation and
dissemination of short, single focus, utility programs for
programmers. Hence the name Software Shorts. In the
tradition of true software geeks, Software Shorts believes
utility programs should be inexpensive, if not free, and in
the hands of as many people as possible. However, Software
Shorts utility programs may not be distributed by any
individual or corporation as part of a commercial software
release, unless the utility has been licensed to that
individual or corporation for such distribution.
The first version of CRONJR was released in November of
1988. It has been thoroughly debugged. It has also been in
constant use since that time, with it now being May 1991.
If you use CRONJR after the two week evaluation period,
please pay the $45.00 registration fee. The $45.00
registration fee will entitle you to a version of CRONJR with
the fight song removed. Payment of the $75.00 registration
and update fee will entitle you to the "silent" version of
CRONJR and any future releases of CRONJR.
Send registration fees to:
Software Shorts
14101 Yorba Street Suite 101
Tustin, CA 92680
Please specify the desired media format as 5.25/360k or 3.5/720k.
Since the primary distribution of this program will be
via bulletin boards and the targeted end users are LAN
managers, and programmers, it is strongly recommended that
you purchase a registered version of CRONJR for your own
security reasons.
If you have received CRONJR as part of a distribution
diskette included with a book, please note that Software
Shorts provided its product, with permission, at no charge
to the publisher.