-input_file for Jobs

For most job verbs, you can specify all of the needed properties in a property file. You can also provide a few properties on the command line. Properties set on the command line override values set in the file.

The property file consists of name=value pairs. For example, put the following into myFile.txt:

name=MY JOB 1
    type=OSCommand
    description=this is a test job
    target_list=target1:host
    variable.default_shell_command=ls -l
    schedule.frequency=IMMEDIATE

... then run:

emcli create_job -input_file=property_file:myFile.txt

This creates an OS Command job called "MY JOB 1" using preferred credentials.

Usage of Properties

For the create verbs, all properties set in the file are used. For verbs that act on multiple jobs, like suspend and resume, only "search" properties are used (name, type, targets. and scheduled starting and ending times).

Creating a Property File

The best way to create a property file is to start by describing a job similar to the one you want to create, and/or by describing a job type. This provides a list of which properties are needed by a given job type.

Determining Variables for a Job

Most properties are the same from one job to another. For example:

name, type, description, kind, targetType, cred, schedule notification

The variables needed for a job type change from job to job. Describe a job type to find out which variables it requires.

For example, the following command creates a property file template based on job MYJOB1. This lists the properties set by this job.

emcli describe_job [-verbose] -name=MyJob1 > myPropFile.txt

This example creates a property file template for an OS Command job. This lists the properties allowed by this job type, including all required and optional variables. Variables marked as deprecated should be avoided.

emcli describe_job_type [-verbose] -type=OSCommand > myPropFile.txt