syncthing-stignore.5 6.4 KB

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