Network Deployment (Distributed operating systems), v8.0 > Administer applications and their environment > Administer the batch environment > Administer the batch environment > batch jobs and their environment


Command-line interface

The command-line interface interacts with the job scheduler to submit and manipulate a batch job. It is located in the was_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:

lrcmd commands. The table includes arguments, a description, and additional information for the lrcmd command.

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. New feature:
-cmd=submit
-xJCL=
<xjcl_filename>
[-host=
<host>]
[-port=
<port>],
or
-cmd=submit -job=
<job_name>
[-startDate=
<startDate>
- startTime=
<startTime>]
[-host=
<host>]
[-port=
<port>]
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:

  • Use -host= <host> as the on-demand router (ODR) host name or job scheduler server host name. If not specified, the default is localhost.

  • Use -port= <port> as the ODR HTTP Proxy address or job scheduler server HTTP port. If not specified, the default is 80.

Both variations of the command return a job ID for the submitted job.

Examples:

  • lrcmd -cmd=submit -xJCL=myxjcl.xml -host=myhost -port=81
  • New feature: lrcmd -cmd=submit -xJCL=myxjcl.xml
  • lrcmd -cmd=submit -job=myjob

Cancel a previously submitted job.
-cmd=cancel
-jobid=
<jobid> [-
<host>] [-port=
<port>]
This command cancels the start of a previously submitted job, or cancels the execution of a running job.

Use -jobid= <jobid> 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. The -cmd=status command can also be used to identify the job ID for a particular job.

Optional arguments:

  • Use -host= <host> as the ODR host name or job scheduler server host name. If not specified, the default is localhost.

  • Use -port= <port> as the ODR HTTP Proxy address or job scheduler server HTTP port. If not specified, the default is 80.

Example:

lrcmd -cmd=cancel -jobid=myjob:2 -host=myLRShost -port=9083

Restart a job.
-cmd=restart
-jobid=
<jobid> [-host=
<host>] [-port=
<port>]
This command restarts the start of a job. Only jobs in restartable state can be restarted.

Use -jobid= <jobid> 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. The -cmd=status command can also be used to identify the job ID for a particular job.

Optional arguments:

  • Use -host= <host> as the ODR host name or job scheduler server host name. If not specified, the default is localhost.

  • Use -port= <port> as the ODR HTTP Proxy address or job scheduler server HTTP port. If not specified, the default is 80.

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:

lrcmd -cmd=restart -jobid=myjob:2 -host=myLRShost -port=9081

Purge job information.
-cmd=purge
-job=
<jobid>
[-host=
<host>] [-port=
<port>]
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 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.

Optional arguments:

  • Use -host= <host> as the ODR host name or job scheduler server host name. If not specified, the default is localhost.

  • Use -port= <port> as the ODR HTTP Proxy address or job scheduler server HTTP port. If not specified, the default is 80.

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:

lrcmd -cmd=purge -jobid=myjob:2

Show the status of a batch job.
-cmd=status
or
-cmd=status
-jobid=
<jobid>
[-host=
<host>] [-port=
<port>]
This command displays status information about one or more jobs in the job scheduler database.

Optional argument: -job= <jobid>, if specified, indicates that only job information for the specified job is displayed.

Examples:

  • lrcmd -cmd=status host=myODRHost -port=83
  • lrcmd -cmd=submit -xJCL=myxjcl.xml (returns job ID LongRunningScheduler:17)
  • lrcmd -cmd=status -jobid=LongRunningScheduler:17

Suspend a job.
-cmd=suspend
-jobid=
<jobid>
-seconds=
<seconds> [-host=
<host>] [-port=
<port>]
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 -jobid= <jobid> 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. The -cmd=status command can also be used to identify the job ID for a particular job.

Optional arguments:

Use -seconds= <seconds> to indicate the number of seconds that the job start is suspended. If not specified, the default value of 15 seconds is used. If -seconds=0 is specified, the job does not start until manually resumed.

  • Use -host= <host> as the ODR host name or job scheduler server host name. If not specified, the default is localhost.

  • Use -port= <port> as the ODR HTTP Proxy address or job scheduler server HTTP port. If not specified, the default is 80.

Examples:

lrcmd -cmd=submit -xJCL=myxjcl.xml (returns job ID myjob:23). After job myjob:23 has begun execution, it can be suspended for five minutes (for example), with: lrcmd -cmd=suspend -jobid=myjob:23 -seconds=300 -port=81 -host=myODRHost

Execution of the job can be resumed before the 5 minutes expires with: lrcmd -cmd=resume -jobid=myjob:23

Resume start of a previously suspended job.
-cmd=resume
-jobid=
<jobid> [-host=
<host>] [-port=
<port>]
This command resumes start of a previously suspended batch job.

Use -jobid= <jobid> 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. The -cmd=status command can also be used to identify the job ID for a particular job.

See description of -cmd=suspend.
Display the output for a job.
-cmd=output
-jobid=
<jobid> [-host=
<host>] [-port=
<port>]
Displays the output generated by the job scheduler and grid endpoint during the execution of the specified 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)
Display the return code of a batch job.
-cmd=getBatchJobRC
-jobid=
<jobid> [-host=
<host>] [-port=
<port>]
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.

  • Use -host= <host> as the ODR host name or job scheduler server host name. If not specified, the default is localhost.

  • Use -port= <port> as the ODR HTTP Proxy address or job scheduler server HTTP port. If not specified, the default is 80.

(none)

lrcmd commands. The table includes arguments, a description, and additional information for the lrcmd command.

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.
-cmd=stop
[-jobid=
<job_id> [-host=
<host>]
[-port=
<port>]
This command stops the execution of a previously submitted job when a checkpoint occurs.

Use -jobid= <jobid> as the job ID assigned to the job by the job scheduler

Optional arguments:

  • Use -host= <host> as the ODR host name or job scheduler server host name. If not specified, the default is localhost.

  • Use -port= <port> as the ODR HTTP Proxy address or job scheduler server HTTP port. If not specified, the default is 80.

Examples:

  • lrcmd -cmd=stop -jobid=MyApp:1 -port=80 -host=myodrhost.com
  • lrcmd -cmd=stop -jobid=MyApp:1 -port=9080 -host=mygshost.com -userid=myname -password=mypassword

Show the symbolic variables that are referenced in the job definition xJCL.
-cmd=getSymbolicVariables
-xJCL=
<xjcl_file> [-
<host>] [-port=
<port>]
This command shows the symbolic variables which are referenced in the job definition xJCL.

Use -jobid= <jobid> as the job ID assigned to the job by the job scheduler

Optional arguments:

  • Use -XJCL= <xjcl_file> to specify the path of the job definition xJCL file which describes the grid job.

  • Use -job= <job_name> to specify the job name, which is a key in the job repository of the job scheduler.

  • Use -host= <host> as the ODR host name or job scheduler server host name. If not specified, default is localhost.

  • Use -port= <port> as the ODR HTTP Proxy address or job scheduler server HTTP port. If not specified, the default is 80.

Examples:

  • lrcmd -cmd=getSymbolicVariables -xJCL=C:\myXJCL -port=9080 -host=mygshost.com
  • lrcmd -cmd=getSymbolicVariables -job=MyJob -port=80 -host=myodrhost.com -userid=myname -password=mypassword

Save the job log.
-cmd=saveJobLog
-jobid=
<job_id> [-host=
<host>] [-fileName=
<fileName>]
This command saves the job log associated with the requested job identifier to the local file system.

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. The

Use -fileName= <fileName> to indicate the name of a file on the local file system where the compressed job log data is to be saved. The file is replaced if it exists. The file name <fileName>might not contain embedded blanks.

Optional arguments:

  • Use -host= <host> as the ODR host name or job scheduler server host name. If not specified, the default is localhost.

  • Use -port= <port> as the ODR HTTP Proxy address or job scheduler server HTTP port. If not specified, the default is 80.

Examples:

  • lrcmd -cmd=saveJobLog -jobid=MyApp:1 -fileName=/tmp/myZippedJobLog -port=80 -host=myodrhost.com
  • lrcmd -cmd=saveJobLog -jobid=MyApp:1 -fileName=/tmp/mySavedJobLog -port=9080 -host=mygshost.com -userid=myname -password=mypassword

Get job log.
-cmd=getJobLog -jobid=
<job_id> 
Displays the job log associated with the requested job identifier.

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.

Optional arguments:

  • Use -host= <host> as the ODR host name or job scheduler server host name. If not specified, the default is localhost.

  • Use -port= <port> as the ODR HTTP Proxy address or job scheduler server HTTP port. If not specified, the default is 80.

Examples:

  • lrcmd -cmd=getJobLog -jobid=MyApp:1 -port=80 -host=myodrhost.com
  • lrcmd -cmd=getJobLog -jobid=MyApp:1 -port=9080 -host=mygshost.com -userid=myname -password=mypassword

Purge job log
-cmd=getJobLog -jobid=
<job_id>
-logTimeStamp=
<logTimeStamp>

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.

  • 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 -logTimeStamp= <logTimeStamp to indicate the time stamp, the subdirectory name, which identifies the job log to be removed. The time stamp is returned by -cmd=getLogMetaData.

  • Use -userid= <user_id> to specify the user ID required when the job scheduler server is running in secure mode.

  • Use -password= <password> to specify the password required when the job scheduler server is running in secure mode.

Examples:

  • lrcmd -cmd=getLogMetaData -jobid=PostingsSampleEar:99 -port=80 -host=myodrhost.com -userid=myname -password=mypassword
  • lrcmd -cmd=purgeJobLog -jobid=PostingsSampleEar:99 -port=80 -logTimeStamp=14022007_164535 -host=myodrhost.com -userid=myname -password=mypassword

Display the job log metadata for the requested job identifier.
-cmd=getLogMetaData -jobid=
<job_id>
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 -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.

Examples:

  • lrcmd -cmd=getLogMetaData -jobid=MyApp:1 -port=80 -host=myodrhost.com
  • lrcmd -cmd=getLogMetaData -jobid=MyApp:1 -port=9080 -host=mygshost.com

Display the job log part list.
-cmd=getLogPartList -jobid=
<job_id>
-logTimeStamp=
<logTimeStamp>
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 -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.

Examples:

  • lrcmd -cmd=getLogPartList -jobid=MyApp:1 -logTimeStamp=20102006_155529 -port=80 -host=myodrhost.com
  • lrcmd -cmd=getLogPartList -jobid=MyApp:1 -logTimeStamp=20102006_155529 -port=9080 -host=myodrhost.com -userid=myname -password=mypassword

Display the job log part.
-cmd=getLogPart -jobid=
<job_id>
-logTimeStamp=
<logTimeStamp>
-logPart=
<logPart>
Displays the job log part associated with the requested job identifier, log time stamp, and log part.

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 -logTimeStamp= <logTimeStamp>to indicate the time stamp (the subdirectory name), which identifies the job log whose part list information is to be returned. The time stamp is returned by -cmd=getLogMetaData.

Use -logPart= <logPart> to indicate the portion of the job log associated with the requested job identifier and time stamp to be returned. The log part information is returned by -cmd=getLogPartList.

Examples:

  • lrcmd -cmd=submit -xJCL=myxjcl.xml -host=myhost -port=80 (returns a job identifier of PostingsSampleEar:99)
  • lrcmd -cmd=getLogMetaData -jobid=PostingsSampleEar:99 (returns the timestamp 14022007_164535)
  • lrcmd -cmd=getLogPart -jobid=PostingsSampleEar:99 -logTimeStamp=14022007_164535 -logPart=part.1.log

Display the size of the job log associated with the requested job identifier.
-cmd=getLogSize -jobid=
<job_id> -logTimeStamp=
<logTimeStamp> 
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 -logTimeStamp= <logTimeStamp> to indicate the time stamp; that is, the subdirectory name, which identifies the job log whose part list information is to be returned. The time stamp is returned by -cmd=getLogMetaData.

Examples:

  • lrcmd -cmd=getLogSize -jobid=MyApp:1 -logTimeStamp=20102006_155529 -port=80 -host=myodrhost.com
  • lrcmd -cmd=getLogSize -jobid=MyApp:1 -logTimeStamp=20102006_155529 -port=9080 -host=myodrhost.com -userid=myname -password=mypassword

Return the age of the job log in the seconds since it was last modified.
-cmd=getLogAge -jobid=
<job_id> -logTimeStamp=
<logTimeStamp>
Displays the age of the

  • lrcmd -cmd=getLogAge -jobid=MyApp:1 -logTimeStamp=20102006_155529 -port=80 -host=myodrhost.com
  • lrcmd -cmd=getLogAge -jobid=MyApp:1 -logTimeStamp=20102006_155529 -port=9080 -host=myodrhost.com -userid=myname -password=mypassword

Job log associated with the requested job identifier.

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.

Use -logTimeStamp= <logTimeStamp> to indicate the time stamp; that is, the subdirectory name, which identifies the job log whose part list information is to be returned. The time stamp is returned by -cmd=getLogMetaData.

Examples:

  • lrcmd -cmd=getLogAge -jobid=MyApp:1 -logTimeStamp=20102006_155529 -port=80 -host=myodrhost.com
  • lrcmd -cmd=getLogAge -jobid=MyApp:1 -logTimeStamp=20102006_155529 -port=9080 -host=myodrhost.com -userid=myname -password=mypassword


Example

Example of retrieving output of a batch job:

lrcmd -cmd=output -jobid=mybatchjob:63 -host=myLRSHost -port=9081

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

batch jobs and their environment
Job management console

+

Search Tips   |   Advanced Search