syncthing-stignore.5 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. .\" Man page generated from reStructuredText.
  2. .
  3. .TH "SYNCTHING-STIGNORE" "5" "April 08, 2016" "v0.12" "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 nodes, 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 repository. The
  49. \fB\&.stignore\fP file itself will never be synced to other nodes, although it can
  50. \fB#include\fP files that \fIare\fP synchronized between nodes. All patterns are
  51. relative to the repository root.
  52. .SH PATTERNS
  53. .sp
  54. The \fB\&.stignore\fP file contains a list of file or path patterns. The
  55. \fIfirst\fP pattern that matches will decide the fate of a given file.
  56. .INDENT 0.0
  57. .IP \(bu 2
  58. Regular file names match themselves, i.e. the pattern \fBfoo\fP matches
  59. the files \fBfoo\fP, \fBsubdir/foo\fP as well as any directory named
  60. \fBfoo\fP\&. Spaces are treated as regular characters.
  61. .IP \(bu 2
  62. Asterisk matches zero or more characters in a filename, but does not
  63. match the directory separator. \fBte*st\fP matches \fBtest\fP,
  64. \fBsubdir/telerest\fP but not \fBtele/rest\fP\&.
  65. .IP \(bu 2
  66. Double asterisk matches as above, but also directory separators.
  67. \fBte**st\fP matches \fBtest\fP, \fBsubdir/telerest\fP and
  68. \fBtele/sub/dir/rest\fP\&.
  69. .IP \(bu 2
  70. Question mark matches a single character that is not the directory
  71. separator. \fBte??st\fP matches \fBtebest\fP but not \fBteb/st\fP or
  72. \fBtest\fP\&.
  73. .IP \(bu 2
  74. 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.
  75. .IP \(bu 2
  76. A pattern beginning with \fB/\fP matches in the current directory only.
  77. \fB/foo\fP matches \fBfoo\fP but not \fBsubdir/foo\fP\&.
  78. .IP \(bu 2
  79. A pattern beginning with \fB#include\fP results in loading patterns
  80. from the named file. It is an error for a file to not exist or be
  81. included more than once. Note that while this can be used to include
  82. patterns from a file in a subdirectory, the patterns themselves are
  83. still relative to the repository \fIroot\fP\&. Example:
  84. \fB#include more\-patterns.txt\fP\&.
  85. .IP \(bu 2
  86. A pattern beginning with \fB!\fP negates the pattern: matching files
  87. are \fIincluded\fP (that is, \fInot\fP ignored). This can be used to override
  88. more general patterns that follow. Note that files in ignored
  89. directories can not be re\-included this way. This is due to the fact
  90. that Syncthing stops scanning when it reaches an ignored directory,
  91. so doesn\(aqt know what files it might contain.
  92. .IP \(bu 2
  93. A pattern beginning with \fB(?i)\fP enables case\-insensitive pattern
  94. matching. \fB(?i)test\fP matches \fBtest\fP, \fBTEST\fP and \fBtEsT\fP\&. The
  95. \fB(?i)\fP prefix can be combined with other patterns, for example the
  96. pattern \fB(?i)!picture*.png\fP indicates that \fBPicture1.PNG\fP should
  97. be synchronized. Note that case\-insensitive patterns must start with
  98. \fB(?i)\fP when combined with other flags. On Mac OS and Windows,
  99. patterns are always case\-insensitive.
  100. .IP \(bu 2
  101. A line beginning with \fB//\fP is a comment and has no effect.
  102. .IP \(bu 2
  103. Windows does not support escaping \fB\e[foo \- bar\e]\fP\&.
  104. .UNINDENT
  105. .SH EXAMPLE
  106. .sp
  107. Given a directory layout:
  108. .INDENT 0.0
  109. .INDENT 3.5
  110. .sp
  111. .nf
  112. .ft C
  113. foo
  114. foofoo
  115. bar/
  116. baz
  117. quux
  118. quuz
  119. bar2/
  120. baz
  121. frobble
  122. My Pictures/
  123. Img15.PNG
  124. .ft P
  125. .fi
  126. .UNINDENT
  127. .UNINDENT
  128. .sp
  129. and an \fB\&.stignore\fP file with the contents:
  130. .INDENT 0.0
  131. .INDENT 3.5
  132. .sp
  133. .nf
  134. .ft C
  135. !frobble
  136. !quuz
  137. foo
  138. *2
  139. qu*
  140. (?i)my pictures
  141. .ft P
  142. .fi
  143. .UNINDENT
  144. .UNINDENT
  145. .sp
  146. all files and directories called "foo", ending in a "2" or starting with
  147. "qu" will be ignored. The end result becomes:
  148. .INDENT 0.0
  149. .INDENT 3.5
  150. .sp
  151. .nf
  152. .ft C
  153. foo # ignored, matches "foo"
  154. foofoo # synced, does not match "foo" but would match "foo*" or "*foo"
  155. bar/ # synced
  156. baz # synced
  157. quux # ignored, matches "qu*"
  158. quuz # synced, matches "qu*" but is excluded by the preceding "!quuz"
  159. bar2/ # ignored, matched "*2"
  160. baz # ignored, due to parent being ignored
  161. frobble # ignored, due to parent being ignored; "!frobble" doesn\(aqt help
  162. My Pictures/ # ignored, matched case insensitive "(?i)my pictures" pattern
  163. Img15.PNG # ignored, due to parent being ignored
  164. .ft P
  165. .fi
  166. .UNINDENT
  167. .UNINDENT
  168. .sp
  169. \fBNOTE:\fP
  170. .INDENT 0.0
  171. .INDENT 3.5
  172. Please note that directory patterns ending with a slash
  173. \fBsome/directory/\fP matches the content of the directory, but not the
  174. directory itself. If you want the pattern to match the directory and its
  175. content, make sure it does not have a \fB/\fP at the end of the pattern.
  176. .UNINDENT
  177. .UNINDENT
  178. .SH EFFECTS ON "IN SYNC" STATUS
  179. .sp
  180. Currently the effects on who is in sync with what can be a bit confusing
  181. when using ignore patterns. This should be cleared up in a future
  182. version...
  183. .sp
  184. Assume two nodes, Alice and Bob, where Alice has 100 files to share, but
  185. Bob ignores 25 of these. From Alice\(aqs point of view Bob will become
  186. about 75% in sync (the actual number depends on the sizes of the
  187. individual files) and remain in "Syncing" state even though it is in
  188. fact not syncing anything (\fI\%issue #623\fP <\fBhttps://github.com/syncthing/syncthing/issues/623\fP>). From Bob\(aqs point of view, it\(aqs
  189. 100% up to date but will show fewer files in both the local and global
  190. view.
  191. .sp
  192. If Bob adds files that have already been synced to the ignore list, they
  193. will remain in the "global" view but disappear from the "local" view.
  194. The end result is more files in the global repository than in the local,
  195. but still 100% in sync (\fI\%issue #624\fP <\fBhttps://github.com/syncthing/syncthing/issues/624\fP>). From Alice\(aqs point of view, Bob
  196. will remain 100% in sync until the next reconnect, because Bob has
  197. already announced that he has the files that are now suddenly ignored.
  198. .SH AUTHOR
  199. The Syncthing Authors
  200. .SH COPYRIGHT
  201. 2015, The Syncthing Authors
  202. .\" Generated by docutils manpage writer.
  203. .