WebSphere Extended Deployment, Version 6.0.x
             Operating Systems: AIX, HP-UX, Linux, Solaris, Windows, z/OS


The command line interface

The command line interface interacts with the long-running scheduler to submit and manipulate a long-running job. It is located in the was_root/bin directory as the lrcmd.sh or lrcmd.bat script and can be invoked from any location in the WebSphere cell.

Use the lrcmd script to perform the following commands:

Table 1. lrcmd commands
Command Arguments Description Additional Information
Display usage information for lrcmd. None This command displays usage information for the lrcmd command. Example: lrcmd
Submit a job to the long-running scheduler.
-cmd=submit 
-xJCL=<xjcl_filename> 
[-job= <job_name>
(-add | -replace)]
[-startDate=<startDate> 
-startTime=<startTime>] 
[-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 -job=<job_name> as the name of a saved XJCL in xJCL repository to specify the name to use when saving the xJCL to the repository of job xJCL. See -cmd=save for additional information.
  • Use -add to add the xJCL to the repository of job xJCL using the specified job name.
  • Use -replace to replace or add the xJCL to the repository of job xJCL using the specified job name.
  • Use -startDate=<startDate> as the date in which the job is submitted to run where the required startDate format is yyyy-MM-dd. Requires the -startTime parameter to be defined.
  • Use startTime=<startTime>as the time in which the job is submitted to run where the required startTime format is HH:mm:ss. This parameter requires you to define the -startDate parameter as well.
  • Use -host=<host> as the on-demand router (ODR) host name or long-running scheduler server host name. If not specified, the default is localhost.
  • Use -port=<port> as the ODR HTTP Proxy address or long-running 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
  • lrcmd -cmd=submit -xJCL=myxjcl.xml -add -job=myjob
  • lrcmd -cmd=submit -job=myjob
  • lrcmd -cmd=submit -xJCL=C:\\myXJCL -add -job=MyJob -port=80-startDate=2005-11-25-startTime=23:59:00
  • lrcmd -cmd=submit -job=MyJob -startDate=2005-11-25 -startTime=23:59:00
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 an executing job.

Use -jobid=<jobid> as the job ID assigned to the job by the long-running 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 long-running scheduler server host name. If not specified, the default is localhost.
  • Use -port=<port> as the ODR HTTP Proxy address or long-running 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 long-running 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 long-running scheduler server host name. If not specified, the default is localhost.
  • Use -port=<port> as the ODR HTTP Proxy address or long-running scheduler server HTTP port. If not specified, the default is 80.
Only a long-running 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 long-running scheduler and execution environments.

Use -jobid=<jobid> as the job ID assigned to the job by the long-running 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 long-running scheduler server host name. If not specified, the default is localhost.
  • Use -port=<port> as the ODR HTTP Proxy address or long-running scheduler server HTTP port. If not specified, the default is 80.
The long-running scheduler maintains information about a job after the job has completed. The purge command permanently deletes job information from the long-running scheduler and execution environment databases. The command also purges the job's job log.

Example:

lrcmd -cmd=purge -jobid=myjob:2

Save an xJCL to the job repository.
-cmd=save 
-xJCL=<xjcl_filename> 
-job=<job_name> 
[-host=<host>] [-port=<port>]
This command saves an xJCL document in the job repository for use by future -cmd=submit commands.
  • Use -xJCL=<xjcl_filename> to specify the file name of the xJCL file to be saved.
  • Use -job=<job_name> to specify the name to use when saving the xJCL to the repository of job xJCL.
  • The job name can be used on future -cmd=submit commands to reference the saved xJCL.
Optional arguments:
  • Use -host=<host> as the ODR host name or long-running scheduler server host name. If not specified, the default is localhost.
  • Use -port=<port> as the ODR HTTP Proxy address or long-running scheduler server HTTP port. If not specified, the default is 80.

Examples:

  • lrcmd -cmd=save -xJCL=myxjcl.xml -job=myjob -host=myODRHost -port=82
  • lrcmd -cmd=submit -job=myjob
Remove a job from the job repository.
-cmd=remove 
-job=<job_name>
[-host=<host>] [-port=<port>]
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.

  • Use -host=<host> as the ODR host name or long-running scheduler server host name. If not specified, the default is localhost.
  • Use -port=<port> as the ODR HTTP Proxy address or long-running scheduler server HTTP port. If not specified, the default is 80.
Example:

lrcmd -cmd=remove -jobid=myjob:2 -host=myhost -port=9083

Show xJCL stored in the job repository.
-cmd=show 
-job=<job_name>
This command displays xJCL stored in the job repository.

Use -job=<job_name> to specify the name assigned to the job when it was saved to the job repository.

Examples:
  • lrcmd -cmd=save -xJCL=myxjcl.xml -job=myjob
  • lrcmd -cmd=show -job=myjob
Show the status of a long-running job.
-cmd=status
or
-cmd=status 
-jobid=<jobid> 
[-host=<host>] [-port=<port>]
This command displays status information about one or more jobs in the long-running 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 long-running 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 long-running scheduler server host name. If not specified, the default is localhost.
  • Use -port=<port> as the ODR HTTP Proxy address or long-running scheduler server HTTP port. If not specified, the default is 80.

Examples:

lrcmd -cmd=submit -xJCL=myxjcl.xml (returns job id myjob:23) Once 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 five 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 long-running 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 long-running scheduler and execution environment during the execution of the specified job.

Use -jobid=<jobid> as the ID assigned to the job by the long-running 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)
Displays 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 long-running 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 long-running scheduler server host name. If not specified, the default is localhost.
  • Use -port=<port> as the ODR HTTP Proxy address or long-running scheduler server HTTP port. If not specified, the default is 80.
(none)
Submit a recurring job request to the long-running scheduler .
-cmd=submitRecurringRequest 
-xJCL=<XML file name> 
-request=<name of request> 
-startDate=<date where first job gets submitted>
-startTime=<time where job gets submission>
-interval=<time period between job submissions>
[-host=<host>] [-port=<port>]
or
-cmd=submitRecurringRequestjo b=<job_name> 
-request=<name of request> 
-startDate=<date where first job gets submitted>
-startTime=<time where job gets submission>
-interval=<time period between job submissions>
[-host=<host>] [-port=<port>]
Submits a recurring job request to the job scheduler. The job scheduler submits a long-running job against the specified xJCL at time intervals indicated by the arguments.
  • Use xJCL=<xjcl_filename> to specify the path of the xJCL to be submitted from the file system and optionally saved.
  • Use -request=<name of request> as the unique name of the request used to identify this recurring job submission request. Use-startDate=<date where first job gets submitted> as the date in which the first job gets submitted for start where the required startDate format is yyyy-MM-dd. Requires the -startTime parameter to be defined as well.
  • Use -startTime=<time where job gets submission> as the time in which the first job and all subsequent recurring jobs get submitted for start where the required startTime format is HH:mm:ss. Note that this parameter requires the startDate parameter to be defined as well.
  • Use -interval=<time period between job submissions> as the time period between two job submissions for this recurring job request, where the supported time periods are daily, weekly and monthly.
Optional arguments:
  • The name of a saved XJCL in xJCL repository. See -cmd=save for additional information.
  • -host=<host> The ODR host name or long-running scheduler server host name. If not specified, default is localhost.
  • -port=<port> The ODR HTTP Proxy address or long-running scheduler server HTTP port. If not specified, default is 80.

Examples:

  • lrcmd :-cmd=submitRecurringRequest-xJCL=C:\\myxJCL -port=81 -request=MyMonthlyReport -interval=monthly -startDate=2006-01-02 -startTime=23:59:00
  • lrcmd -cmd=submitRecurringRequest -job=WeeklyJob -request=MyWeeklyReport -interval=weekly -startDate=2006-01-02 -startTime=23:59:00
Modify an existing recurring job request.
lrcmd -cmd=modifyRecurringRequest 
-request=<name of request> 
-xJCL=<XML file name> 
-interval=<time period between job submissions>
-startDate=<date where first job gets submitted>
-startTime=<time where job gets submission>
Arguments:
  • Use <name of request>as the unique name of the request used to identify this recurring job submission request modification.
  • Use <XML file name> as the name of the XML file which describes the long-running job to be scheduled to start.
  • Use <time period between job submissions> as the time period between two job submissions for this recurring job request, where the supported time periods are daily, weekly and monthly.
  • Use <date where first job gets submitted> as the date in which the first job gets submitted for start, where the required startDate format is yyyy-MM-dd. Requires the -startTime parameter to be defined as well.
  • Use <time where job gets submission>as the time in which the first job and all subsequent recurring jobs get submitted to start, where the required startTime format is HH:mm:ss. Requires the -startDate parameter to be defined as well.
One of the following parameters must be defined for this command: -xJCL, -interval (-startDate and -startTime).

Optional arguments:

  • Use -port: as the ODR proxy HTTP address or long-running scheduler server HTTP port. The default is 80.
  • Use -host: as the ODR host or long-running scheduler host. The default is localhost.
Examples:

lrcmd -cmd=modifyRecurringRequest -request=MyWeeklyReport -xJCL=C:\\myNewXJCL -port=80

lrcmd -cmd=modifyRecurringRequest -request=MyWeeklyReport -startDate=2006-02-02 -startTime=22:30:00 -xJCL=C:\\myFebXJCL -port=80

Cancel an existing recurring job request.  
Arguments:
  • Use <name of request> as the unique name of the request used to identify this recurring job submission request.
Example: lrcmd-cmd=cancelRecurringRequest -request=MyWeeklyReport -port=80
Show details of an existing recurring job request.
lrcmd 
-cmd=getRecurringRequestDetails
-request=<name of request>

Use <name of request> as the unique name of the request used to identify this recurring job submission request.

Optional arguments:
  • Use -port: as the ODR proxy HTTP address or long-running scheduler server HTTP port The default is 80.
  • Use -host: as the ODR host or long-running scheduler host. The default is localhost.
Example: lrcmd -cmd=getRecurringRequestDetails -request=MyWeeklyReport-port=80
List all existing recurring job requests.
lrcmd -cmd=showAllRecurringRequests
none Example: lrcmd -cmd=showAllRecurringRequests -port=80
Show all recurring jobs of a request.
lrcmd -cmd=showRecurringJobs
-request=<name of request>
Use <name of request> as the unique name of the request used to identify this recurring job submission request.
Optional arguments:
  • use -port: as the ODR proxy HTTP address or long-running scheduler server HTTP port. The default is 80.
  • Use -host: as the ODR host or long-running scheduler host. The default is localhost.
Examples: lrcmd -cmd=showRecurringJobs -request=MyWeeklyReport -port=81lrcmd -cmd=status -jobid=<job identifier>-port=80 -host=myodrhost.comlrcmd -cmd=status -port=80-host=myodrhost.com

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



Related concepts
Managing long-running jobs and their environment
Concept topic    

Terms of Use | Feedback

Last updated: Oct 16, 2009 11:08:29 AM EDT
http://publib.boulder.ibm.com/infocenter/wxdinfo/v6r0/index.jsp?topic=/com.ibm.websphere.xd.doc/info/scheduler/cbgcommd.html