Overview
Agent tags can be used in Distribution, Consolidation, and Script jobs to automate part of the setup and make it more flexible.
By default, agents have two tags already set up, AGENT_NAME and AGENT_ID. These tags can be viewed and edited in the Agents tab -> Edit tags. Tag names are allowed only in upper case - when creating and using them, tag values can be any case. No spaces are allowed, use underscore (_) instead.
There are several places in Resilio Connect to use agent tags.
Using tags in 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, tag prefix TAG_ must be used. 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 system.
In this example script will remove 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.
Read more about scripting here.
Using tags in paths
One of the use cases is to distribute/consolidate files and organize them into the relevant subfolders. Tags in paths are not supported for synchronization jobs.
Create a new tag on Agents tab, give it a name and value. Value can be either absolute or relative path (just a subfolder). When using tags in path, tag prefix SRC or DST are required for distribution and consolidation jobs, not required for 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.
Default sample is using "%SRC:AGENT_NAME%" tag in destination group path for Consolidation job. That tag means that destination agents will be arranging the files into subfolder per source agent name.
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. We can add a tag CLIENT 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 DST prefix, which basically means that destination agent with tag CLIENT = A will receive content of C:\Document\Files\A directory:
Automatically group 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, agents from different geographical locations shall be added to a specific groups. It makes sense to add a tag LOCATION to agents and create a rule in groups' settings to accept agents only from a given location. Read more about sorting here.
Pausing a job on a condition
The change of tag's value may trigger pausing or unpausing a job run. Configure a job to follow a specific tag and check it for a specified value. Read more about conditional pausing here.