Ignoring and Whitelisting Files on Agents (Ignore List)

Overview

If you don’t want Resilio Connect Agents to track and sync some files in your sync folder, use IgnoreList(Blacklist). There are two places where it lives.

Default IgnoreList file, which is created inside .sync directory in the root of syncing directory for Sync jobs and destination agents for transfer jobs.This is a UTF-8 encoded text file and mainly ignores system, cache, temporary and other similar files. You can remove any lines or add new ones

Global Ignore list in Job Profile.This ignore list applies to all agents in the job and extends default IgnoreList. Global IgnoreList can be used to ‘cancel’ some entries from default IgnoreList (see section “Whilelisting” below)

Syntax for global blacklist is the same as for local. However, here it does not matter which slash (forward or backslash) you use, agents will resolve it themselves. Local Ignore List shall have the correct slash for their operating systems though.

If either Black List is composed when creating the job, i.e. before it’s deployed on agents, agents won’t be indexing and calculating the files in job’s size.

Create & Edit Ignore List in .sync Directory

To create and edit default IgnoreList before job, manually create .sync directory in the root of syncing directory for Sync jobs and destination agents for transfer jobs and place the IgnoreList file, attached at the bottom of this article, there.

For Sync job it’s possible to edit IgnoreList when job is already configured and running. However, agents won’t reduce the size and number of already indexed and synced files, but new ones will be Ignored.

If you need some agents to have an individual list of ignored files, use default IgnoreList for that.

Agents will report different number of files though show status ‘Synced’

Ignoring files and folders

Important Note

IgnoreList is case sensitive!

Wildcards

IgnoreList supports ? and * wildcard symbols.

? substitutes any single character in a filename

* substitutes a string of several (any number) characters in a filename

For example, an IgnoreList containing the following entries will force to ignore all the .pdf files in the share, as well as all .txt files starting with abc, followed by a letter.

*.pdfabc?.txt

Paths

Each line in the ignore list can represent both a directory and a file. ​​For example, this line will force Agents to ignore all the files called MyTest, as well as all the directories called MyTest, including their content and all subdirectories.

MyTest

If an ignore filter consists of 2 components, it will be applied to the root of a sync folder. For example this line will ignore subfolder CDE of ABC which is located only in the root of a sync folder. The folder 123\ABC\CDE will not be ignored.

ABC\CDE

Another example:

FOO\*FOO2\*.txt

This will ignore all files in the subfolder folder named FOO located in the root of sync share, and all txt files in FOO2 subfolder. If you want to ignore all the FOO and FOO2 folders including the ones deeper than the root level, you’ll need to add a line FOO.

The second component can have zero length, which means that presence of a delimiter character in a filter also forces the filter to be applied to the root sync folder. ​For example this line will force Sync to ignore a FOO folder only in the root sync directory.

\FOO

With the above mentioned ignore lines, the following folder structure will behave this way

\ABC //will be synced CDE //will not be synced, ignored by ABC\CDE\123 //will be synced ABC //will be synced CDE //will be synced Filename.pdf //will not be synced, ignored by *.pdf\FOO //will not be synced, ignored by FOO\* QWER //will not be synced

Double asterisk allows to ignore any amount of subfolders between root folder and target folder. For example,

a/**/b

filter will ignore folders a/b, a/x/b, a/x/y/b and so on.

About Delimiters

When composing a filter consisting of 2 or more components, note that path delimiters are OS-dependent and not universal. So please do not forget to use / for Mac and unix-based OSes, while for Windows OSes use \.

Important Note

the IgnoreList is applied to the folder where it is contained and its subfolders. It will not work with the files that have already been synced.

Timings and delays

Once Agent has scanned and indexed the directory tree of a sync folder, all the structural info is going to be stored in its database and always passed to other peers (until you disconnect the sync folder). It means that if you create or edit your IgnoreList file after the directory is added to an Agent, the folder structure will always be fully synced, however, actual files / folders added to the ignore list will not be passed to other agents.

Resilio Connect re-reads IgnoreList every time it is changed or, if system notifications are not coming for some reason, every Rescan interval. We recommend to restart Agents if you want to apply changes in the IgnoreList immediately.

Whitelisting files and folders

Whitelisting works in a similar manner as ignoring, although you need to comply with one simple rule: whitelist rules must start with ! symbol (no quotes). Whitelist rules are always of higher priority than exclude rules, so their position in the list does not matter.

You can use global IgnoreList in Profile to force agents to sync entires that are ignored by default IgnoreList. For example, default IgnoreList on each agent has entry ~* meaning that agents won’t sync items starting with a tilde. Edit global IgnoreList in Profile and add line !~* , all agents will start syncing new items starting with tilde. However, those that are already ignored, will stay ignored and not synced. To fix that you’ll need to recreate the job.

To create pure whitelist, the first (ignore) filter should be all files * followed by a number of whitelist filters starting with !. For example, the whitelist allowing only synchronization of PDF files should look like: