Running A Job from the Command Line - 23.1

Spectrum Dataflow Designer Guide

Version
23.1
Language
English
Product name
Spectrum Technology Platform
Title
Spectrum Dataflow Designer Guide
Copyright
2024
First publish date
2007
Last updated
2024-10-11
Published on
2024-10-11T22:55:47.128293

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]
Required Argument Description
No -? Prints usage information.
No -d delimiter Sets instance/status delimiter. This appears in synchronous output only.
No -e Use a secure HTTPS connection for communication with the Spectrum Technology Platform server.
No -f property file Specifies 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 name Specifies the name or IP address of the Spectrum Technology Platform server.
No -i poll interval Specifies how often to check for completed jobs, in seconds. This applies only in synchronous mode.
Yes -j job name A comma-separated list of jobs to run. Job names are case-sensitive. Jobs are started in the order listed.
No -n email list Specifies 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 password The 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 port The socket (port) on which the Spectrum Technology Platform server is running. The default is 8080.
No -t timeout Sets 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 name The login name of the user.
No -v Return verbose output.
No -w Runs 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.

No StageName Overrides the input or output file specified in Read from File or Write to File. This is defined in the format:

StageName=Protocol:FileName

For more information, see Overriding Job File Locations.

No StageName:schema Overrides the file layout definition specified in Read from File or Write to File with one defined in a schema file. This is defined in the format:

StageName:schema=Protocol:SchemaFile

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