Command-line interface for batch jobs
The command-line interface interacts with the job scheduler to submit and manipulate a batch job. It is located in the app_server_root/bin directory as the lrcmd.sh or lrcmd.bat script and can be started from any location in the WebSphere® cell.
Use the lrcmd script to perform the following commands:
| Command | Arguments | Description | Additional Information |
|---|---|---|---|
| Display usage information for lrcmd. | None | The command displays usage information for the lrcmd command. | Example: lrcmd |
| Submit a job to the job scheduler. | |
When an XML Job Control Language (xJCL) file
is specified, -xJCL=<xjcl_filename> specifies
the path of the xJCL to be submitted from the file system and optionally
saved. Optional arguments:
Both variations of the command return a job ID for the submitted job. |
Examples:
|
| Cancel a previously submitted job. | |
This command cancels the start of a previously
submitted job, or cancels the execution of a running job. Use Optional
arguments:
|
Example:
|
| Restart a job. | |
This command restarts a canceled job. Only jobs
in restartable state can be restarted. Use Optional
arguments:
|
Only a batch job associated with
batch applications can be restarted. When a batch job is canceled
using the -cmd=cancel command, its state is changed
to restartable. When the job is restarted, processing resumes from the last successfully committed checkpoint. Example:
|
| Purge job information. | |
This command purges job information from the job scheduler and grid endpoints. The job scheduler maintains information about a job after the job has completed. The purge command permanently deletes job information from the job scheduler and grid endpoint databases. The command also purges the job log of the job. Use -jobid=<jobid> as
the job ID assigned to the job by the job scheduler. The job
ID is returned by the Optional
arguments:
|
The job scheduler maintains
information about a job after the job has completed. The purge command
permanently deletes job information from the job scheduler and grid endpoint databases.
The command also purges the job log of the job. Example:
|
| Save an xJCL to the job repository. | |
This command saves an xJCL document in the job
repository for use by future -cmd=submit commands.
Optional arguments:
|
Examples:
|
| Remove a job from the job repository. | |
This command removes a previously saved xJCL
document from the job repository. Use -job=<job_name> to specify the name assigned to the job when you previously saved the file to the job repository.
|
Example:
|
| Show the status of a batch job. | or |
This command displays status information about
one or more jobs in the job scheduler database. Optional
argument: |
Examples:
|
| Suspend a job. | |
This command suspends the start of a grid batch
job for the specified number of seconds. Unless manually resumed
(with lrcmd -cmd=resume, for example), the job automatically
resumes running after the specified number of seconds.Use Optional arguments: Use
|
Examples:
Execution of the job can be resumed
before the 5 minutes expires with: |
| Resume start of a previously suspended job. | |
This command resumes start of a previously suspended
batch job. Use |
See description of -cmd=suspend. |
| Display the output for a job. | |
Displays the output generated by the job scheduler and grid endpoint during the
execution of the specified job. Use |
(none) |
| Display the return code of a batch job. | |
Displays the overall return code produced by
a grid batch job. Use
-jobid=<jobid> as
the ID assigned to the job by the job scheduler. The job
ID is returned by the lrcmd -cmd=submit command
that initially submitted the job. The -cmd=status command
can also be used to identify the job ID for a particular job.
|
(none) |
| Submit a recurring job request to the job scheduler . | or |
Submits a recurring job request to the job scheduler.
The job scheduler submits a batch job against the
specified xJCL at time intervals indicated by the arguments.
Optional arguments:
|
Examples:
|
| Modify an existing recurring job request. | |
Arguments:
-xJCL, -interval (-startDate and -startTime).Optional arguments:
|
Examples:
|
| Command | Arguments | Description | Additional information |
|---|---|---|---|
| Display usage information for lrcmd. | None | This command displays usage information for
the lrcmd command. |
Example: lrcmd |
| Stop the execution of a previously submitted job. | |
This command stops the execution of a previously
submitted job when a checkpoint occurs. Use Optional
arguments:
|
Examples:
|
| Show the symbolic variables that are referenced in the job definition xJCL. | |
This command shows the symbolic variables which
are referenced in the job definition xJCL. Use Optional
arguments:
|
Examples:
|
| Save the job log. | |
This command saves the job log associated with
the requested job identifier to the local file system. Use Use Optional arguments:
|
Examples:
|
| Get job log. | |
Displays the job log associated with the requested
job identifier. Use Optional arguments:
|
Examples:
|
| Purge job log | |
Removes the job log associated with the requested
job identifier and log time stamp. A job log entry remains in, for
example: /opt/IBM/WebSphere/AppServer/profiles/scheduler/joblogs/PostingsSampleEar_99/14022007_164535/part.0.log.
The entry tracks the reason why the job log was removed.
|
Examples:
|
| Display the job log metadata for the requested job identifier. | |
The job log metadata indicates the log time
stamps associated with the requested job identifier. The metadata
or time stamp identifies a unique instance of the job. Logs from
multiple different jobs with the same job number can exist. Use |
Examples:
|
| Display the job log part list. | |
Displays the job log part list associated with
the requested job identifier and log time stamp. Use the command getLogMetaData to
return a timestamp to use with -logTimeStamp=<timestamp>.Use |
Examples:
|
| Display the job log part. | |
Displays the job log part associated with the
requested job identifier, log time stamp, and log part. Use Use Use |
Examples:
|
| Display the size of the job log associated with the requested job identifier. | |
This command returns the size of the job login
bytes. Use -jobid=<job_id> as the job ID assigned to the job by the job scheduler. The job ID is returned by the lrcmd -cmd=submit command that initially submitted the job. Use |
Examples:
|
| Return the age of the job log in the seconds since it was last modified. | |
Displays the age of the
Use Use |
Examples:
|
Example of retrieving output of a batch job:
lrcmd
-cmd=output -jobid=mybatchjob:63 -host=myLRSHost -port=9081
Example results:
CWLRB4940I: com.ibm.websphere.batch.wsbatch : -cmd=output -jobid=mybatchjob:63
CWLRB5000I: Wed Jun 15 17:55:36 EDT 2005 : com.ibm.websphere.batch.wsbatch : response to output
CWLRB1740I: [Wed Jun 15 17:55:36 EDT 2005] Job [mybatchjob:63] is in job setup.
CWLRB1760I: [Wed Jun 15 17:55:37 EDT 2005] Job [mybatchjob:63] is submitted for execution.
CWLRB2420I: [Wed Jun 15 17:55:37 EDT 2005] Job [mybatchjob:63] Step [Step1] is in step setup.
CWLRB2440I: [Wed Jun 15 17:55:38 EDT 2005] Job [mybatchjob:63] Step [Step1] is dispatched.
CWLRB2460I: [Wed Jun 15 17:55:38 EDT 2005] Job [mybatchjob:63] Step [Step1] is in step breakdown.
CWLRB2600I: [Wed Jun 15 17:55:38 EDT 2005] Job [mybatchjob:63] Step [Step1] completed normally rc=0.
CWLRB2420I: [Wed Jun 15 17:55:39 EDT 2005] Job [mybatchjob:63] Step [Step2] is in step setup.
CWLRB2440I: [Wed Jun 15 17:55:39 EDT 2005] Job [mybatchjob:63] Step [Step2] is dispatched.
CWLRB2460I: [Wed Jun 15 17:55:40 EDT 2005] Job [mybatchjob:63] Step [Step2] is in step breakdown.
CWLRB2600I: [Wed Jun 15 17:55:40 EDT 2005] Job [mybatchjob:63] Step [Step2] completed normally rc=4.
End