syncthing-stignore.5 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. .\" Man page generated from reStructuredText.
  2. .
  3. .TH "SYNCTHING-STIGNORE" "5" "Feb 11, 2018" "v0.14" "Syncthing"
  4. .SH NAME
  5. syncthing-stignore \- Prevent files from being synchronized to other nodes
  6. .
  7. .nr rst2man-indent-level 0
  8. .
  9. .de1 rstReportMargin
  10. \\$1 \\n[an-margin]
  11. level \\n[rst2man-indent-level]
  12. level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
  13. -
  14. \\n[rst2man-indent0]
  15. \\n[rst2man-indent1]
  16. \\n[rst2man-indent2]
  17. ..
  18. .de1 INDENT
  19. .\" .rstReportMargin pre:
  20. . RS \\$1
  21. . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
  22. . nr rst2man-indent-level +1
  23. .\" .rstReportMargin post:
  24. ..
  25. .de UNINDENT
  26. . RE
  27. .\" indent \\n[an-margin]
  28. .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
  29. .nr rst2man-indent-level -1
  30. .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
  31. .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
  32. ..
  33. .SH SYNOPSIS
  34. .INDENT 0.0
  35. .INDENT 3.5
  36. .sp
  37. .nf
  38. .ft C
  39. \&.stignore
  40. .ft P
  41. .fi
  42. .UNINDENT
  43. .UNINDENT
  44. .SH DESCRIPTION
  45. .sp
  46. If some files should not be synchronized to other devices, a file called
  47. \fB\&.stignore\fP can be created containing file patterns to ignore. The
  48. \fB\&.stignore\fP file must be placed in the root of the folder. The
  49. \fB\&.stignore\fP file itself will never be synced to other devices, although it can
  50. \fB#include\fP files that \fIare\fP synchronized between devices. All patterns are
  51. relative to the folder root.
  52. .sp
  53. \fBNOTE:\fP
  54. .INDENT 0.0
  55. .INDENT 3.5
  56. Note that ignored files can block removal of an otherwise empty directory.
  57. See below for the (?d) prefix to allow deletion of ignored files.
  58. .UNINDENT
  59. .UNINDENT
  60. .SH PATTERNS
  61. .sp
  62. The \fB\&.stignore\fP file contains a list of file or path patterns. The
  63. \fIfirst\fP pattern that matches will decide the fate of a given file.
  64. .INDENT 0.0
  65. .IP \(bu 2
  66. Regular file names match themselves, i.e. the pattern \fBfoo\fP matches
  67. the files \fBfoo\fP, \fBsubdir/foo\fP as well as any directory named
  68. \fBfoo\fP\&. Spaces are treated as regular characters.
  69. .IP \(bu 2
  70. Asterisk matches zero or more characters in a filename, but does not
  71. match the directory separator. \fBte*st\fP matches \fBtest\fP,
  72. \fBsubdir/telerest\fP but not \fBtele/rest\fP\&.
  73. .IP \(bu 2
  74. Double asterisk matches as above, but also directory separators.
  75. \fBte**st\fP matches \fBtest\fP, \fBsubdir/telerest\fP and
  76. \fBtele/sub/dir/rest\fP\&.
  77. .IP \(bu 2
  78. Question mark matches a single character that is not the directory
  79. separator. \fBte??st\fP matches \fBtebest\fP but not \fBteb/st\fP or
  80. \fBtest\fP\&.
  81. .IP \(bu 2
  82. Characters enclosed in square brackets \fB[]\fP are interpreted as a character range \fB[a\-z]\fP\&. Before using this syntax you should have a basic understanding of regular expression character classes.
  83. .IP \(bu 2
  84. A pattern beginning with \fB/\fP matches in the current directory only.
  85. \fB/foo\fP matches \fBfoo\fP but not \fBsubdir/foo\fP\&.
  86. .IP \(bu 2
  87. A pattern beginning with \fB#include\fP results in loading patterns
  88. from the named file. It is an error for a file to not exist or be
  89. included more than once. Note that while this can be used to include
  90. patterns from a file in a subdirectory, the patterns themselves are
  91. still relative to the folder \fIroot\fP\&. Example:
  92. \fB#include more\-patterns.txt\fP\&.
  93. .IP \(bu 2
  94. A pattern beginning with a \fB!\fP prefix negates the pattern: matching files
  95. are \fIincluded\fP (that is, \fInot\fP ignored). This can be used to override
  96. more general patterns that follow. Note that files in ignored
  97. directories can not be re\-included this way. This is due to the fact
  98. that Syncthing stops scanning when it reaches an ignored directory,
  99. so doesn’t know what files it might contain.
  100. .IP \(bu 2
  101. A pattern beginning with a \fB(?i)\fP prefix enables case\-insensitive pattern
  102. matching. \fB(?i)test\fP matches \fBtest\fP, \fBTEST\fP and \fBtEsT\fP\&. The
  103. \fB(?i)\fP prefix can be combined with other patterns, for example the
  104. pattern \fB(?i)!picture*.png\fP indicates that \fBPicture1.PNG\fP should
  105. be synchronized. On Mac OS and Windows, patterns are always case\-insensitive.
  106. .IP \(bu 2
  107. A pattern beginning with a \fB(?d)\fP prefix enables removal of these files if
  108. they are preventing directory deletion. This prefix should be used by any OS
  109. generated files which you are happy to be removed.
  110. .IP \(bu 2
  111. A line beginning with \fB//\fP is a comment and has no effect.
  112. .IP \(bu 2
  113. Windows does not support escaping \fB\e[foo \- bar\e]\fP\&.
  114. .UNINDENT
  115. .sp
  116. \fBNOTE:\fP
  117. .INDENT 0.0
  118. .INDENT 3.5
  119. Prefixes can be specified in any order (e.g. “(?d)(?i)”), but cannot be in a
  120. single pair of parentheses (not “(?di)”).
  121. .UNINDENT
  122. .UNINDENT
  123. .SH EXAMPLE
  124. .sp
  125. Given a directory layout:
  126. .INDENT 0.0
  127. .INDENT 3.5
  128. .sp
  129. .nf
  130. .ft C
  131. \&.DS_Store
  132. foo
  133. foofoo
  134. bar/
  135. baz
  136. quux
  137. quuz
  138. bar2/
  139. baz
  140. frobble
  141. My Pictures/
  142. Img15.PNG
  143. .ft P
  144. .fi
  145. .UNINDENT
  146. .UNINDENT
  147. .sp
  148. and an \fB\&.stignore\fP file with the contents:
  149. .INDENT 0.0
  150. .INDENT 3.5
  151. .sp
  152. .nf
  153. .ft C
  154. (?d).DS_Store
  155. !frobble
  156. !quuz
  157. foo
  158. *2
  159. qu*
  160. (?i)my pictures
  161. .ft P
  162. .fi
  163. .UNINDENT
  164. .UNINDENT
  165. .sp
  166. all files and directories called “foo”, ending in a “2” or starting with
  167. “qu” will be ignored. The end result becomes:
  168. .INDENT 0.0
  169. .INDENT 3.5
  170. .sp
  171. .nf
  172. .ft C
  173. \&.DS_Store # ignored, will be deleted if gets in the way of parent directory removal
  174. foo # ignored, matches "foo"
  175. foofoo # synced, does not match "foo" but would match "foo*" or "*foo"
  176. bar/ # synced
  177. baz # synced
  178. quux # ignored, matches "qu*"
  179. quuz # synced, matches "qu*" but is excluded by the preceding "!quuz"
  180. bar2/ # ignored, matched "*2"
  181. baz # ignored, due to parent being ignored
  182. frobble # ignored, due to parent being ignored; "!frobble" doesn\(aqt help
  183. My Pictures/ # ignored, matched case insensitive "(?i)my pictures" pattern
  184. Img15.PNG # ignored, due to parent being ignored
  185. .ft P
  186. .fi
  187. .UNINDENT
  188. .UNINDENT
  189. .sp
  190. \fBNOTE:\fP
  191. .INDENT 0.0
  192. .INDENT 3.5
  193. Please note that directory patterns ending with a slash
  194. \fBsome/directory/\fP matches the content of the directory, but not the
  195. directory itself. If you want the pattern to match the directory and its
  196. content, make sure it does not have a \fB/\fP at the end of the pattern.
  197. .UNINDENT
  198. .UNINDENT
  199. .SH EFFECTS ON “IN SYNC” STATUS
  200. .sp
  201. Currently the effects on who is in sync with what can be a bit confusing
  202. when using ignore patterns. This should be cleared up in a future
  203. version…
  204. .sp
  205. Assume two devices, Alice and Bob, where Alice has 100 files to share, but
  206. Bob ignores 25 of these. From Alice’s point of view Bob will become
  207. about 75% in sync (the actual number depends on the sizes of the
  208. individual files) and remain in “Syncing” state even though it is in
  209. fact not syncing anything (\fI\%issue #623\fP <\fBhttps://github.com/syncthing/syncthing/issues/623\fP>). From Bob’s point of view, it’s
  210. 100% up to date but will show fewer files in both the local and global
  211. view.
  212. .sp
  213. If Bob adds files that have already been synced to the ignore list, they
  214. will remain in the “global” view but disappear from the “local” view.
  215. The end result is more files in the global folder than in the local,
  216. but still 100% in sync (\fI\%issue #624\fP <\fBhttps://github.com/syncthing/syncthing/issues/624\fP>). From Alice’s point of view, Bob
  217. will remain 100% in sync until the next reconnect, because Bob has
  218. already announced that he has the files that are now suddenly ignored.
  219. .SH AUTHOR
  220. The Syncthing Authors
  221. .SH COPYRIGHT
  222. 2014-2018, The Syncthing Authors
  223. .\" Generated by docutils manpage writer.
  224. .