Resilio Connect Agents create a hidden .sync directory with some service files in the root of a synchronized folder. It is created for all agents in Synchronization and Script jobs. In Distribution and Consolidation jobs - only destination agents have it.
It is not created in virtual Transparent Selective Sync folders on macOS agents. It's created in cloud storages, but with some peculiarities mentioned here.
By this directory the Agent recognized the folder it shall work in. Deleting .sync folder for an active Job renders error message for the Agent.
Here's the structure of .sync. Not all of the items there are present all the time. Some of them are specific for certain types of jobs and Agent settings there. The image does not illustrate all of them.
1) Archive folder. This is the folder with file version and files deleted from remote agents. Read more about Archive here. It's always created. If Archive folder is deleted, Agent won't be able to store files here until restarted.
If agent is removed from job or job itself is removed, Archive remains on disk.
2) FolderType. Contains information about Read-Write or Read-Only access and Selective Sync setting for this agent.
3) ID file. Identifier of directory. It is unique for each agent in each job. Deleting or changing ID file causes "error with ID file" .
If agent is removed from job or job itself is deleted, ID file is removed from disk as well.
4) IgnoreList. A plaintext file which keeps rules for items that Agent will ignore. Read more about IgnoreFile here.
If agent is removed from job or job itself is removed, IgnoreList remains on disk.
5) root_acl_entry. A service file that makes agent track NTFS and POSIX permissions change for the shared folder itself. Don't touch this file.
If agent is removed from job or job itself is deleted, root_acl_entry is deleted from disk.
6) Streams folder. Agent is capable of syncing extended files attributed (xattrs) and alt streams. If the operating system does not support a synced streams format, these are stored in Streams directory so as not to break synchronization. Agent can pass these over to other agents.
7) StreamsList. A plaintext file that instructs agent to synchronize files xattrs. Read more about Streams here.
8) Files with .!sync extension. It's the file that is being downloaded now. When agent is syncing a file, it first write it into .sync directory and then moves to its proper place with a single move
operation.