Running A Job from the Command Line

Before you can run a job from the command line, it must be exposed. To expose a job, open the job in Spectrum Enterprise Designer and select File > Expose/Unexpose and Save.

To run a job from the command line, you must install the job executor utility on the system where you want to run the job. The Job Executor is available from the Spectrum Technology Platform Welcome page on the Spectrum Technology Platform server (for example, http://myserver:8080).

Usage

java -jar jobexecutor.jar -u UserID -p Password -j Job [Optional Arguments]
RequiredArgumentDescription
No-?Prints usage information.
No-d delimiterSets instance/status delimiter. This appears in synchronous output only.
No-eUse a secure HTTPS connection for communication with the Spectrum Technology Platform server.
No-f property fileSpecifies a path to a job property file. A job property file contains job executor arguments. For more information on job property files, see Using a Job Property File.
No-h host nameSpecifies the name or IP address of the Spectrum Technology Platform server.
No-i poll intervalSpecifies how often to check for completed jobs, in seconds. This applies only in synchronous mode.
Yes-j job nameA comma-separated list of jobs to run. Job names are case-sensitive. Jobs are started in the order listed.
No-n email listSpecifies a comma-separated list of additional email addresses for configured job notifications.
No-o property file

Specifies a path to a flow options property file. Use a flow options property file to set options for stages in the flow. In order to set flow options using a property file, you must configure the flow to expose stage options at runtime. For more information, see Adding Flow Runtime Options.

For example, a flow options properties file for a flow that contains an Assign GeoTAX Info stage may look like this:

OutputCasing=U
UseStreetLevelMatching=N
TaxKey=T
Database.GTX=gsl
Yes-p passwordThe password of the user.
No-r

Specify this argument to return a detailed report about the job. This option only works if you also specify -w . The report contains this information:

  • Position 1 - Name of job
  • Position 2 - Job process ID
  • Position 3 - Status
  • Position 4 - Start Date-Time (MM/DD/YYYY HH:MM:SS)
  • Position 5 - End Date-Time (MM/DD/YYYY HH:MM:SS)
  • Position 6 - Number of successful records
  • Position 7 - Number of failed records
  • Position 8 - Number of malformed records
  • Position 9 - Currently unused

For example:

MySimpleJob|4|succeeded|04/09/2019 14:50:47|04/09/2019 14:50:47|100|0|0|

The information is delimited using the delimiter specified in the -d argument.

No-s portThe socket (port) on which the Spectrum Technology Platform server is running. The default is 8080.
No-t timeoutSets the timeout (in seconds) for synchronous mode. The default is 3600. The maximum is 2147483. This is a global, aggregate timeout and represents the maximum time to wait for all spawned jobs to complete.
Yes-u user nameThe login name of the user.
No-vReturn verbose output.
No-wRuns job executor in synchronous mode. This means that job executor remains running until the job completes.

If you do not specify -w, job executor exits after starting the job, unless the job reads from or writes to files on the server. In this case, job executor will run until all local files are processed, then exit.

NoStageName=Protocol:FileNameOverrides the input or output file specified in Read from File or Write to File. For more information, see Overriding Job File Locations.
NoStageName:schema=Protocol:SchemaFileOverrides the file layout definition specified in Read from File or Write to File with one defined in a schema file. For more information, see Overriding the File Format at the Command Line.

Example Use of Job Executor

This example shows command line invocation and output:

D:\spectrum\job-executor>java -jar jobexecutor.jar -u user123 -p "mypassword" -j validateAddressJob1 -h spectrum.example.com -s 8888 -w -d "%" -i 1 -t 9999

validateAddressJob1%105%succeeded

In this example, the output indicates that the job named 'validateAddressJob1' ran (with identifier 105) with no errors. Other possible results include "failed" or "running."