17.0 Object triggers > References > Job triggers

Conventions

17.10 Job triggers

For security reasons, job triggers are disabled by default. They must be enabled in order to successfully attach triggers to jobs (See Enabling job triggers for more information.).

Triggers attached to jobs follow the same basic rules and formats as attaching them to other objects; however, not all attribute options are valid for each object. Jobs, like other objects, have a unique set of trigger rules. The table below details the methods, options, and other notable details associated with attaching triggers to jobs.

Creation methods

Method Format Example

Command line on job creation: msub -l

msub <jobName> -l 'trig=<trigSpec>'

Attributes are delimited by backslash ampersand (\&).

 

> msub my.job -l 'trig=EType=create\&AType=exec\&Action="/jobs/my_trigger.pl"\&Offset=10:00'

Command line on existing job: mschedctl - c mschedctl -c trigger <trigSpec> -o job:<jobID>

> mschedctl -c trigger EType=end,AType=mail,Action="Job moab.54 has ended" -o job:moab.54

Job template in moab.cfgJOBCFG

JOBCFG[<templateName>] TRIGGER=<trigSpec>

JOBCFG[vmcreate] TRIGGER=,EType=end,AType=exec,Action="/tmp/jobEnd.sh"

Valid event types

Valid action types

Mail recipient

The job's owner

See Using a trigger to send email for more information.