commandsjob trigger

Add/delete a job trigger.

Usage

job trigger (add|delete) name state target

where
add add the specified trigger.
delete delete the specified trigger.
name of job whose trigger to add/delete.
state of target job, where state is one of the following:
running target is running.
stopped target is stopped. i.e not running. This is a superset of success, error, exception, missed and killed.
success last execution of target was successful.
failed last execution of target was error, exception, missed or killed.
error last execution of target returned an error.
exception last execution of target resulted in an exception. This is likely due to an issue within BeyondCron.
missed last execution of target was missed because one or more of its conditions were not met.
killed last execution of target was killed.
target job/s to which trigger refers. target supports both group wildcards, /group/*, which will match all jobs within a group, and recursive wildcards, /group/**, which will match all jobs within or below a group.

write on name, read on target.

Examples

Add a trigger to a job

Trigger the weekly reboot job when the daily backup job stops.

BeyondCron % job trigger add /examples/server/reboot stopped /examples/server/backup
BeyondCron % job show $$

----------- ---------------------------------------- Name /examples/server/reboot Description Weekly reboot ... Triggers /examples/server/backup state is stopped ...

Add a group trigger

Trigger an alert job when any job within the group /examples/server, returns an error.

BeyondCron % job trigger add /alert/error error /examples/server/*
BeyondCron % job show $$

----------- ---------------------------------- Name /alert/error Description Alert when a job returns an error ... Triggers /examples/server/* result is error ...

Add a recursive trigger

Trigger an alert when any job is missed.

BeyondCron % job trigger add /alert/missed missed /**
BeyondCron % job show $$

----------- -------------------------- Name /alert/missed Description Alert when a job is missed ... Triggers /** result is missed ...

Delete a job trigger

BeyondCron % job trigger delete /examples/server/reboot stopped /examples/server/backup
BeyondCron % job show full $$

----------- ----------------------- Name /examples/server/reboot Description Weekly reboot ... Triggers ...

See also