bc-clijob condition

Add/delete a job start condition.

Usage

job condition (add|delete) name state target [in last n unit]

where
add add the specified condition.
delete delete the specified condition.
name of job whose condition 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 condition refers. target supports group wildcards, /group/*, which will match all jobs within a group.
n Optional maximum age of target job state. Default is unlimited.
unit of n. Where unit is one of minute[s], hour[s], day[s] or week[s].

write on name

Examples

Add a condition to a job

Ensure that the weekly reboot job does not start whilst the daily backup job is running.

BeyondCron % job condition add /examples/server/reboot stopped /examples/server/backup
BeyondCron % job list full reboot

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

Delete a job condition

BeyondCron % job condition delete /examples/server/reboot stopped /examples/server/backup

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

See also