Using Agent tags
Overview
Agent tags can be used in Distribution, Consolidation, and Run Script Jobs to automate part of the setup and make it more flexible. You can also take advantage of tags to automatically assign Agents to groups.
By default, agents have two predefined tags: AGENT_NAME and AGENT_ID.
To access Agent tags, select Agents > Edit tags.
Note
Tag names are allowed only in upper case - when creating and using them, tag values can be any case. No white space characters are allowed, use underscore _ instead.
There are several areas in your Resilio Active Everywhere deployment where you can use tags.
Commands and scripts
Using tags in scripts is similar to using variables. Tags can be used in expressions and output. The default sample of using tags in commands is echoing Job results into the log file. When specifying the command, use the TAG_ prefix. On Windows, the correct syntax for using a tag is %TAG_AGENT_NAME%, on Unix that will be $TAG_AGENT_NAME. The correct syntax of the command itself depends on the operating system.
In this example, the script removes the directory after the Job's completion from the source Agent on Windows. Before creating this Job, create a new tag AGENT_ROLE with value SRC for the relevant Agents.
For more information on scripting, see Scripts.
Job folder paths
One of the use cases is to distribute or consolidate files, and organize them into the relevant subfolders.
Note
Tags in paths are not supported for synchronization Jobs.
Create a new tag on Agents tab, give it a name and value. The value can be either absolute or relative path (just the subfolder).
Note
When using tags in path, the SRC or the DST tag prefix is required for Distribution and Consolidation Jobs. These are not required for Run Script Jobs.
When specifying the path upon Job creation use the created tag as %SRC:TAG_NAME% or %DST:TAG_NAME%. These prefixes will resolve the tag into the path for source or destination agents accordingly.
An example is using the %SRC:AGENT_NAME% tag in the destination group path for a Consolidation Job. This causes the destination Agents to arrange the files into subfolders named after the source Agents.
Another example is using tags in Distribution Jobs. For example, on source server there is a directory with subfolders (A, B, C) each of which is destined for a specific Agent. Add the CLIENT tag with values A, B, C for the corresponding Agent. When creating a Job, at Path step, pick the path and use the CLIENT tag with the DST prefix. This way the contents of the C:\Document\Files\A folder will be transferred to the Agent with the A value in the CLIENT tag.
Automatically grouping Agents
Agent tags can be used to create sorting rules for groups. A tag and its value acts as a condition for an Agent to join a group automatically. For example, you want to group Agents by their location. Add the LOCATION tag to Agents and create a rule in groups' settings to accept agents only from a given location. For more information on assigning Agents to groups, see Automatically assign Agents to groups
Pausing a Job on a condition
The change of tag's value may trigger pausing or resuming a Job run. Configure a Job to follow a specific tag and check it for a given value. For more information, see Conditional pausing Job run on an Agent.


