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 likeNAME_of_TAG=tag_value
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.
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.