Dec 082017
 
CRONJR is a batch scheduler; it is used to run stand alone programs at specific times and intervals.
File CRONJR.ZIP from The Programmer’s Corner in
Category Batch Files
CRONJR is a batch scheduler; it is used to run stand alone programs at specific times and intervals.
File Name File Size Zip Size Zip Type
CRON.EXE 25918 14354 deflated
CRONJR.SCH 389 193 deflated
MANUAL.DOC 15491 5713 deflated
README.BAT 33 33 stored
README.TXT 277 154 deflated

Download File CRONJR.ZIP Here

Contents of the README.BAT file


ECHO OFF
CLS
TYPE README.TXT


Contents of the README.TXT file


ECHO OFF
CLS
TYPE README.TXT
To print out the manual, type the following command at the DOS promt.

C:\> copy manual.doc prn

To do a quick installation, type the following commands at the DOS prompt.

C:\> md cron
C:\> cd cron
C:\CRON> copy a:cron*.*
C:\CRON> cron start
C:\CRON> cronjr





Contents of the MANUAL.DOC file


ECHO OFF
CLS
TYPE README.TXT
To print out the manual, type the following command at the DOS promt.

C:\> copy manual.doc prn

To do a quick installation, type the following commands at the DOS prompt.

C:\> md cron
C:\> cd cron
C:\CRON> copy a:cron*.*
C:\CRON> cron start
C:\CRON> cronjr




CRONJR
By
Software Shorts


Thank you for retrieving CRONJR. This is a full working
version of CRONJR.

CRONJR is a batch scheduler; it is used to run
stand alone programs at specific times and intervals.


Requirements
------------

MS-DOS based machine running MS-DOS 3.30 or higher.
MS-DOS versions below 3.1 - 3.21 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-30k 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. If you
want to run an .EXE or .COM file then you lose the
option of command line parameters and must resort to
running a batch file which brings us back to the first
problem of loading COMMAND.COM.

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

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

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!!!!!!

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
recommended. The expected outcome is that only the
hour increment will be used.

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 45 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:45.

Well it is now 19:46 and all tasks scheduled from 19:01
through 19:46 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.

If you have an OS/2 version of CRONJR then this problem
can be completely avoided.


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.


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 simply
because they were bells and whistles that no one wanted to
hear.

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 is a 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 and OS/2 are 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 January 1990.

If you find CRONJR to be a worthwhile program, a
contribution of $45.00 would be appreciated. With each
contribution of $75.00 you will be registered to receive a
diskette with the next version of CRONJR, and other Software
Shorts utility programs when available. Please state the
current version of the CRONJR program you have.

Send contributions to:
Software Shorts
14101 Yorba Street Suite 101
Tustin, CA 92680

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 your company has been targeted by Software Shorts as
a company that could benefit from our products, then you may
be able to receive FREE Software Shorts utility distribution
diskettes. These diskettes contain full working versions of
whatever software they contain. These are not demo disks.
These diskettes are not a solicitation for money or services.



 December 8, 2017  Add comments

Leave a Reply