syncthing-stignore man page

syncthing-stignore — Prevent files from being synchronized to other nodes

Synopsis

.stignore

Description

If some files should not be synchronized to other devices, a file called .stignore can be created containing file patterns to ignore. The .stignore file must be placed in the root of the folder. The .stignore file itself will never be synced to other devices, although it can #include files that are synchronized between devices. All patterns are relative to the folder root.

NOTE:

Note that ignored files can block removal of an otherwise empty directory. See below for the (?d) prefix to allow deletion of ignored files.

Patterns

The .stignore file contains a list of file or path patterns. The first pattern that matches will decide the fate of a given file.

NOTE:

Prefixes can be specified in any order (e.g. “(?d)(?i)”), but cannot be in a single pair of parentheses (not “(?di)”).

NOTE:

Include patterns (that begin with !) cause Syncthing to traverse and watch the entire directory tree regardless of other ignore patterns.

Example

Given a directory layout:

.DS_Store
foo
foofoo
bar/
    baz
    quux
    quuz
bar2/
    baz
    frobble
My Pictures/
    Img15.PNG

and an .stignore file with the contents:

(?d).DS_Store
!frobble
!quuz
foo
*2
qu*
(?i)my pictures

all files and directories called “foo”, ending in a “2” or starting with “qu” will be ignored. The end result becomes:

.DS_Store     # ignored, will be deleted if gets in the way of parent directory removal
foo           # ignored, matches "foo"
foofoo        # synced, does not match "foo" but would match "foo*" or "*foo"
bar/          # synced
    baz       # synced
    quux      # ignored, matches "qu*"
    quuz      # synced, matches "qu*" but is excluded by the preceding "!quuz"
bar2/         # synced, despite matching "*2" due to child frobble
    baz       # ignored, due to parent being ignored
    frobble   # synced, due to "!frobble"
My Pictures/  # ignored, matched case insensitive "(?i)my pictures" pattern
    Img15.PNG # ignored, due to parent being ignored
NOTE:

Please note that directory patterns ending with a slash some/directory/ matches the content of the directory, but not the directory itself. If you want the pattern to match the directory and its content, make sure it does not have a / at the end of the pattern.

Author

The Syncthing Authors

Referenced By

syncthing(1).

Jun 11, 2019 v1 Syncthing