In this article, I am not talking about the job command in unix. I am talking about batch job.
A job can be defined as the smallest unit of work in a job scheduler. Following is some attributes of a job:
# | Attributes |
Description |
1. | Executing Member Name |
In unix, this is the name of the job script to be executed. In mainframe, this is the member name of the JCL. |
2. | Resident Directory |
In unix, this is the directory which stores the job script to be executed. |
3. | Job Owner |
This is the user-id to execute the job member.
|
4. | Machine name |
Some scheduler acts as an central job dispatching agent. This field tells the scheduler which machine the job is to be executed. |
5. | some job ordering information |
This specify when the job is order to the machine waiting for execution. For example :
- every 5 minute everyday
- every 5 minute every business day
- every 4 hour from 07:00 to 19:00 (both inclusive) everyday
- at 01:01 daily
- at 01:02 every business day
- at 02:21 every Monday
- at 02:22 every Monday and Thursday
- at 03:31 every 1st of the month
- at 03:32 on the last day of every month
- at 03:33 on the last business day of every month
- at 04:41 on March 31st of every year
- at 04:42 on December 31st of every year
|
6. | incoming condition |
A job is going to be executed only when this incoming condition(s) is satisfied. The incoming condition(s) is actually the outgoing condition(s) of the preceding job(s). Of course, some incoming condition can be an alarm time, e.g. at 0:00 every day. |
7. | outgoing condition |
When the job is executed successfully, it will give out this outgoing condition(s) to the scheduler. This outgoing condition(s) is actually the incoming condition(s) of succeeding job(s). |
Of course, there are some more attributes. Different scheduler software will have its own set of attributes. The above is some common ones.
These attributes altogether will form a job record. All the job records will be stored in a job database. At regular time, the job scheduler will then scan the database to extract those job records to order (or give birth) jobs in the job agent machine (e.g. a PC) to wait for execution. When the incoming condition(s) of a job is satisfied, the job script member will then put into the unix machine to run.
It is very important to understand that a job is NOT a script nor a JCL. A job is much more than a script or a JCL. For example, a job has incoming condition(s) and outgoing condition(s). A script or JCL will not have this condition information.
Also, in the OO terminology a job is a class declaration, NOT an object. When the job is order out, an object of that job is created. In order words, job ordering is one way to NEW a job object.
When job object is newly born, its status is waiting for execution. When incoming condition is fulfilled, a script in a unix machine will be executed. If the script is executed successfully, the job object will change status to successfully run. Then, it will generate out condition(s) to the job scheduler. When to clean-up these job objects (i.e. garbage collection in Java terminology) ? The job scheduler will do it in regular base.
Each job object will have its own sysout information to store those messages issued by the printf or echo command in the job script. This is similar to the case that each object will have its own variables and methods in the OO terminoloty.
The job scheduler take full control of all job objects.