SYNCTHING-STIGNORE(5) | Syncthing | SYNCTHING-STIGNORE(5) |
syncthing-stignore - Prevent files from being synchronized to other nodes
.stignore
If some files should not be synchronized to (or from) 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 synced folder (files in other locations are not applied). 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 synced folder root. The contents of the .stignore file must be UTF-8 encoded.
NOTE:
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:
Any #include directives inside a file loaded by #include require paths specified relative to the directory containing the loaded file, rather than the synchronised root directory.
NOTE:
NOTE:
Top-level include patterns are treated as special cases and will not force Syncthing to scan (or watch) the entire directory tree. For example: !/foo is a top-level include pattern, while !/foo/bar is not.
Given a directory layout starting at the synced folder’s root:
.DS_Store .stignore 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:
New in version 1.19.0: Default patterns can be configured which will take effect when automatically accepting a folder from a remote device. The GUI suggests same the patterns when adding a folder manually. In either case, the .stignore file is created with these defaults if none is present yet.
The Syncthing Authors
2014-2019, The Syncthing Authors
December 21, 2023 | v1.27.0 |