syncthing-stignore.5 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. .\" Man page generated from reStructuredText.
  2. .
  3. .TH "SYNCTHING-STIGNORE" "5" "June 14, 2015" "v0.11" "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.
  97. .IP \(bu 2
  98. A line beginning with \fB//\fP is a comment and has no effect.
  99. .UNINDENT
  100. .SH EXAMPLE
  101. .sp
  102. Given a directory layout:
  103. .INDENT 0.0
  104. .INDENT 3.5
  105. .sp
  106. .nf
  107. .ft C
  108. foo
  109. foofoo
  110. bar/
  111. baz
  112. quux
  113. quuz
  114. bar2/
  115. baz
  116. frobble
  117. My Pictures/
  118. Img15.PNG
  119. .ft P
  120. .fi
  121. .UNINDENT
  122. .UNINDENT
  123. .sp
  124. and an \fB\&.stignore\fP file with the contents:
  125. .INDENT 0.0
  126. .INDENT 3.5
  127. .sp
  128. .nf
  129. .ft C
  130. !frobble
  131. !quuz
  132. foo
  133. *2
  134. qu*
  135. (?i)my pictures
  136. .ft P
  137. .fi
  138. .UNINDENT
  139. .UNINDENT
  140. .sp
  141. all files and directories called "foo", ending in a "2" or starting with
  142. "qu" will be ignored. The end result becomes:
  143. .INDENT 0.0
  144. .INDENT 3.5
  145. .sp
  146. .nf
  147. .ft C
  148. foo # ignored, matches "foo"
  149. foofoo # synced, does not match "foo" but would match "foo*" or "*foo"
  150. bar/ # synced
  151. baz # synced
  152. quux # ignored, matches "qu*"
  153. quuz # synced, matches "qu*" but is excluded by the preceding "!quuz"
  154. bar2/ # ignored, matched "*2"
  155. baz # ignored, due to parent being ignored
  156. frobble # ignored, due to parent being ignored; "!frobble" doesn\(aqt help
  157. My Pictures/ # ignored, matched case insensitive "(?i)my pictures" pattern
  158. Img15.PNG # ignored, due to parent being ignored
  159. .ft P
  160. .fi
  161. .UNINDENT
  162. .UNINDENT
  163. .sp
  164. \fBNOTE:\fP
  165. .INDENT 0.0
  166. .INDENT 3.5
  167. Please note that directory patterns ending with a slash
  168. \fBsome/directory/\fP matches the content of the directory, but not the
  169. directory itself. If you want the pattern to match the director and it\(aqs
  170. content, make sure it does not have a \fB/\fP at the end of the pattern.
  171. .UNINDENT
  172. .UNINDENT
  173. .SH EFFECTS ON "IN SYNC" STATUS
  174. .sp
  175. Currently the effects on who is in sync with what can be a bit confusing
  176. when using ignore patterns. This should be cleared up in a future
  177. version...
  178. .sp
  179. Assume two nodes, Alice and Bob, where Alice has 100 files to share, but
  180. Bob ignores 25 of these. From Alice\(aqs point of view Bob will become
  181. about 75% in sync (the actual number depends on the sizes of the
  182. individual files) and remain in "Syncing" state even though it is in
  183. fact not syncing anything (\fI\%issue #623\fP <\fBhttps://github.com/syncthing/syncthing/issues/623\fP>). From
  184. Bob\(aqs point of view it\(aqs 100% up to date but will show fewer files in
  185. both the local and global view.
  186. .sp
  187. If Bob adds files that have already been synced to the ignore list, they
  188. will remain in the "global" view but disappear from the "local" view.
  189. The end result is more files in the global repository than in the local,
  190. but still 100% in sync (\fI\%issue #624\fP <\fBhttps://github.com/syncthing/syncthing/issues/624\fP>). From
  191. Alice\(aqs point of view, Bob will remain 100% in sync until the next
  192. reconnect, because Bob has already announce that he has the files that
  193. 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. .