Skip to content

Conditional pausing job run on an Agent

Starting with version 2.9.3 and newer, it's possible to create some rules for pausing certain jobs on a condition. The rule relies on Agents' tags to match some value. In other words, the job will pause for an Agent if its tag matches the value in the rule.

For example, you know that tag LOCATION may change from 'local' to 'remote' and need to pause a job for it while it's on a remote location. Use the "Pause job if" parameter from Job profile, add a rule like_NAME_of_TAG=tag_value_mceclip0.png

It supports regexp for more complex rules, for example rule _NAME_of_TAG=^(value1|value2)$_ will pause job for agents whose tag name has value1 or value1.

Starting with version 2.12.4, more complex rules with tags united with logical operators AND, OR, NOT and brackets.

Empty value of a tag is supported, for example:

  • Rule _TAG_1= AND TAG_2=^[0-9]$_ is valid and pauses job if value of _TAG_1_ is empty, resumes if the tag gets any value.
  • Rule _T1=_ will search for tag _T1_ with an empty value, The absence of a tag does not match this condition.
  • Rule _NOT T1=_ will always be true (even if the tag absent at all) except when tag _T1_ is set with empty value.

Management Console does not check the validity of the rule.
Resilio Agent only checks the syntax of the rule, but not it being logically correct.
If the syntax is incorrect, the error is reported at first such occasion noticed. if the rule is valid

Example of a valid rule: _(TAG_1=ABC OR TAG_1=XYZ) AND NOT TAG_2 = MNO_

Examples of invalid rules:

_"_T_1_=V1"_  
_"    NOT(T1=V()1)"_  
_"  NOT  NOT(T1=V()1)"_  
_"    NOT(T1=V()1ANDT2=V2)"_  
_"T1=^V\\$\\$\\(\\)()1$"_

Pause set by this rule is of higher priority than pause set or unset by Bandwidth Scheduler. If the bandwidth scheduler removes pause for the same time period while rule puts pause on an agent, the agent remains paused.