syncthing-faq.7 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348
  1. .\" Man page generated from reStructuredText.
  2. .
  3. .TH "SYNCTHING-FAQ" "7" "July 27, 2016" "v0.14" "Syncthing"
  4. .SH NAME
  5. syncthing-faq \- Frequently Asked Questions
  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 GENERAL
  34. .SS What is Syncthing?
  35. .sp
  36. Syncthing is an application that lets you synchronize your files across multiple
  37. devices. This means the creation, modification or deletion of files on one
  38. machine will automatically be replicated to your other devices. We believe your
  39. data is your data alone and you deserve to choose where it is stored. Therefore
  40. Syncthing does not upload your data to the cloud but exchanges your data across
  41. your machines as soon as they are online at the same time.
  42. .SS Is it "syncthing", "Syncthing" or "SyncThing"?
  43. .sp
  44. It\(aqs \fBSyncthing\fP, although the command and source repository is spelled
  45. \fBsyncthing\fP so it may be referred to in that way as well. It\(aqs definitely not
  46. SyncThing, even though the abbreviation \fBst\fP is used in some
  47. circumstances and file names.
  48. .SS How does Syncthing differ from BitTorrent Sync?
  49. .sp
  50. The two are different and not related. Syncthing and BitTorrent Sync accomplish
  51. some of the same things, namely syncing files between two or more computers.
  52. .sp
  53. BitTorrent Sync by BitTorrent, Inc is a proprietary peer\-to\-peer file
  54. synchronization tool available for Windows, Mac, Linux, Android, iOS, Windows
  55. Phone, Amazon Kindle Fire and BSD. [1] Syncthing is an open source file
  56. synchronization tool.
  57. .sp
  58. Syncthing uses an open and documented protocol, and likewise the security
  59. mechanisms in use are well defined and visible in the source code. BitTorrent
  60. Sync uses an undocumented, closed protocol with unknown security properties.
  61. .IP [1] 5
  62. \fI\%http://en.wikipedia.org/wiki/BitTorrent_Sync\fP
  63. .SH USAGE
  64. .SS What things are synced?
  65. .sp
  66. The following things are \fIalways\fP synchronized:
  67. .INDENT 0.0
  68. .IP \(bu 2
  69. File Contents
  70. .IP \(bu 2
  71. File Modification Times
  72. .UNINDENT
  73. .sp
  74. The following may be synchronized or not, depending:
  75. .INDENT 0.0
  76. .IP \(bu 2
  77. File Permissions (When supported by file system. On Windows, only the
  78. read only bit is synchronized.)
  79. .IP \(bu 2
  80. Symbolic Links (When supported by the OS. On Windows Vista and up,
  81. requires administrator privileges. Links are synced as is and are not
  82. followed.)
  83. .UNINDENT
  84. .sp
  85. The following is \fInot\fP synchronized;
  86. .INDENT 0.0
  87. .IP \(bu 2
  88. File or Directory Owners and Groups (not preserved)
  89. .IP \(bu 2
  90. Directory Modification Times (not preserved)
  91. .IP \(bu 2
  92. Hard Links (followed, not preserved)
  93. .IP \(bu 2
  94. Extended Attributes, Resource Forks (not preserved)
  95. .IP \(bu 2
  96. Windows, POSIX or NFS ACLs (not preserved)
  97. .IP \(bu 2
  98. Devices, FIFOs, and Other Specials (ignored)
  99. .IP \(bu 2
  100. Sparse file sparseness (will become unsparse)
  101. .UNINDENT
  102. .SS Is synchronization fast?
  103. .sp
  104. Syncthing segments files into pieces, called blocks, to transfer data from one
  105. device to another. Therefore, multiple devices can share the synchronization
  106. load, in a similar way as the torrent protocol. The more devices you have online
  107. (and synchronized), the faster an additional device will receive the data
  108. because small blocks will be fetched from all devices in parallel.
  109. .sp
  110. Syncthing handles renaming files and updating their metadata in an efficient
  111. manner. This means that renaming a large file will not cause a retransmission of
  112. that file. Additionally, appending data to existing large files should be
  113. handled efficiently as well.
  114. .sp
  115. Temporary files are used to store partial data downloaded from other devices.
  116. They are automatically removed whenever a file transfer has been completed or
  117. after the configured amount of time which is set in the configuration file (24
  118. hours by default).
  119. .SS Why is the sync so slow?
  120. .sp
  121. When troubleshooting a slow sync, there are a number of things to check.
  122. .sp
  123. First of all, verify that you are not connected via a relay. In the "Remote
  124. Devices" list on the right side of the GUI, double check that you see
  125. "Address: <some address>" and \fInot\fP "Relay: <some address>".
  126. [image]
  127. .sp
  128. If you are connected via a relay, this is because a direct connection could
  129. not be established. Double check and follow the suggestions in
  130. firewall\-setup to enable direct connections.
  131. .sp
  132. Second, if one of the devices is a very low powered machine (a Raspberry Pi,
  133. or a phone, or a NAS, or similar) you are likely constrained by the CPU on
  134. that device. See the next question for reasons Syncthing likes a faster CPU.
  135. You can verify this by looking at the CPU utilization in the GUI. If it is
  136. constantly at or close to 100%, you are limited by the CPU speed. In some
  137. cases a lower CPU usage number can also indicate being limited by the CPU \-
  138. for example constant 25% usage on a four core CPU likely means that
  139. Syncthing is doing something that is not parallellizable and thus limited to
  140. a single CPU core.
  141. .sp
  142. Third, verify that the network connection is OK. Tools such as iperf or just
  143. an Internet speed test can be used to verify the performance here.
  144. .SS Why does it use so much CPU?
  145. .INDENT 0.0
  146. .IP 1. 3
  147. When new or changed files are detected, or Syncthing starts for the
  148. first time, your files are hashed using SHA\-256.
  149. .IP 2. 3
  150. Data that is sent over the network is (optionally) compressed and
  151. encrypted using AES\-128. When receiving data, it must be decrypted.
  152. .IP 3. 3
  153. There is a certain amount of housekeeping that must be done to track the
  154. current and available versions of each file in the index database.
  155. .IP 4. 3
  156. By default Syncthing uses periodic scanning every 60 seconds to detect
  157. file changes. This means checking every file\(aqs modification time and
  158. comparing it to the database. This can cause spikes of CPU usage for large
  159. folders.
  160. .UNINDENT
  161. .sp
  162. Hashing, compression and encryption cost CPU time. Also, using the GUI
  163. causes a certain amount of extra CPU usage to calculate the summary data it
  164. presents. Note however that once things are \fIin sync\fP CPU usage should be
  165. negligible.
  166. .sp
  167. To limit the amount of CPU used when syncing and scanning, set the
  168. environment variable \fBGOMAXPROCS\fP to the maximum number of CPU cores
  169. Syncthing should use at any given moment. For example, \fBGOMAXPROCS=2\fP on a
  170. machine with four cores will limit Syncthing to no more than half the
  171. system\(aqs CPU power.
  172. .sp
  173. To reduce CPU spikes from scanning activity, use a filesystem notifications
  174. plugin. This is delivered by default via Synctrayzor, Syncthing\-GTK and on
  175. Android. For other setups, consider using \fI\%syncthing\-inotify\fP <\fBhttps://github.com/syncthing/syncthing-inotify\fP>\&.
  176. .SS Should I keep my device IDs secret?
  177. .sp
  178. No. The IDs are not sensitive. Given a device ID it\(aqs possible to find the IP
  179. address for that node, if global discovery is enabled on it. Knowing the device
  180. ID doesn\(aqt help you actually establish a connection to that node or get a list
  181. of files, etc.
  182. .sp
  183. For a connection to be established, both nodes need to know about the other\(aqs
  184. device ID. It\(aqs not possible (in practice) to forge a device ID. (To forge a
  185. device ID you need to create a TLS certificate with that specific SHA\-256 hash.
  186. If you can do that, you can spoof any TLS certificate. The world is your
  187. oyster!)
  188. .sp
  189. \fBSEE ALSO:\fP
  190. .INDENT 0.0
  191. .INDENT 3.5
  192. device\-ids
  193. .UNINDENT
  194. .UNINDENT
  195. .SS What if there is a conflict?
  196. .sp
  197. Syncthing does recognize conflicts. When a file has been modified on two devices
  198. simultaneously, one of the files will be renamed to \fB<filename>.sync\-
  199. conflict\-<date>\-<time>.<ext>\fP\&. The device which has the larger value of the
  200. first 63 bits for his device ID will have his file marked as the conflicting
  201. file. Note that we only create \fBsync\-conflict\fP files when the actual content
  202. differs.
  203. .sp
  204. Beware that the \fB<filename>.sync\-conflict\-<date>\-<time>.<ext>\fP files are
  205. treated as normal files after they are created, so they are propagated between
  206. devices. We do this because the conflict is detected and resolved on one device,
  207. creating the \fBsync\-conflict\fP file, but it\(aqs just as much of a conflict
  208. everywhere else and we don\(aqt know which of the conflicting files is the "best"
  209. from the user point of view. Moreover, if there\(aqs something that automatically
  210. causes a conflict on change you\(aqll end up with \fBsync\-conflict\-...sync\-conflict
  211. \-...\-sync\-conflict\fP files.
  212. .SS How to configure multiple users on a single machine?
  213. .sp
  214. Each user should run their own Syncthing instance. Be aware that you might need
  215. to configure listening ports such that they do not overlap (see config).
  216. .SS Does Syncthing support syncing between folders on the same system?
  217. .sp
  218. No. Syncthing is not designed to sync locally and the overhead involved in
  219. doing so using Syncthing\(aqs method would be wasteful. There are better
  220. programs to achieve this such as rsync or Unison.
  221. .SS Is Syncthing my ideal backup application?
  222. .sp
  223. No. Syncthing is not a great backup application because all changes to your
  224. files (modifications, deletions, etc) will be propagated to all your
  225. devices. You can enable versioning, but we encourage the use of other tools
  226. to keep your data safe from your (or our) mistakes.
  227. .SS Why is there no iOS client?
  228. .sp
  229. There is an alternative implementation of Syncthing (using the same network
  230. protocol) called \fBfsync()\fP\&. There are no plans by the current Syncthing
  231. team to support iOS in the foreseeable future, as the code required to do so
  232. would be quite different from what Syncthing is today.
  233. .SS How can I exclude files with brackets (\fB[]\fP) in the name?
  234. .sp
  235. The patterns in .stignore are glob patterns, where brackets are used to
  236. denote character ranges. That is, the pattern \fBq[abc]x\fP will match the
  237. files \fBqax\fP, \fBqbx\fP and \fBqcx\fP\&.
  238. .sp
  239. To match an actual file \fIcalled\fP \fBq[abc]x\fP the pattern needs to "escape"
  240. the brackets, like so: \fBq\e[abc\e]x\fP\&.
  241. .sp
  242. On Windows, escaping special characters is not supported as the \fB\e\fP
  243. character is used as a path separator. On the other hand, special characters
  244. such as \fB[\fP and \fB?\fP are not allowed in file names on Windows.
  245. .SS Why is the setup more complicated than BTSync?
  246. .sp
  247. Security over convenience. In Syncthing you have to setup both sides to
  248. connect two nodes. An attacker can\(aqt do much with a stolen node ID, because
  249. you have to add the node on the other side too. You have better control
  250. where your files are transferred.
  251. .sp
  252. This is an area that we are working to improve in the long term.
  253. .SS How do I access the web GUI from another computer?
  254. .sp
  255. The default listening address is 127.0.0.1:8384, so you can only access the
  256. GUI from the same machine. This is for security reasons. Change the \fBGUI
  257. listen address\fP through the web UI from \fB127.0.0.1:8384\fP to
  258. \fB0.0.0.0:8384\fP or change the config.xml:
  259. .INDENT 0.0
  260. .INDENT 3.5
  261. .sp
  262. .nf
  263. .ft C
  264. <gui enabled="true" tls="false">
  265. <address>127.0.0.1:8384</address>
  266. .ft P
  267. .fi
  268. .UNINDENT
  269. .UNINDENT
  270. .sp
  271. to
  272. .INDENT 0.0
  273. .INDENT 3.5
  274. .sp
  275. .nf
  276. .ft C
  277. <gui enabled="true" tls="false">
  278. <address>0.0.0.0:8384</address>
  279. .ft P
  280. .fi
  281. .UNINDENT
  282. .UNINDENT
  283. .sp
  284. Then the GUI is accessible from everywhere. You should set a password and
  285. enable HTTPS with this configuration. You can do this from inside the GUI.
  286. .sp
  287. If both your computers are Unixy (Linux, Mac, etc) You can also leave the
  288. GUI settings at default and use an ssh port forward to access it. For
  289. example,
  290. .INDENT 0.0
  291. .INDENT 3.5
  292. .sp
  293. .nf
  294. .ft C
  295. $ ssh \-L 9090:127.0.0.1:8384 [email protected]
  296. .ft P
  297. .fi
  298. .UNINDENT
  299. .UNINDENT
  300. .sp
  301. will log you into othercomputer.example.com, and present the \fIremote\fP
  302. Syncthing GUI on \fI\%http://localhost:9090\fP on your \fIlocal\fP computer.
  303. .SS Why do I see Syncthing twice in task manager?
  304. .sp
  305. One process manages the other, to capture logs and manage restarts. This
  306. makes it easier to handle upgrades from within Syncthing itself, and also
  307. ensures that we get a nice log file to help us narrow down the cause for
  308. crashes and other bugs.
  309. .SS Where do Syncthing logs go to?
  310. .sp
  311. Syncthing logs to stdout by default. On Windows Syncthing by default also
  312. creates \fBsyncthing.log\fP in Syncthing\(aqs home directory (run \fBsyncthing
  313. \-paths\fP to see where that is). Command line option \fB\-logfile\fP can be used
  314. to specify a user\-defined logfile.
  315. .SS How do I upgrade Syncthing?
  316. .sp
  317. If you use a package manager such as Debian\(aqs apt\-get, you should upgrade
  318. using the package manager. If you use the binary packages linked from
  319. Syncthing.net, you can use Syncthing built in automatic upgrades.
  320. .INDENT 0.0
  321. .IP \(bu 2
  322. If automatic upgrades is enabled (which is the default), Syncthing will
  323. upgrade itself automatically within 24 hours of a new release.
  324. .IP \(bu 2
  325. The upgrade button appears in the web GUI when a new version has been
  326. released. Pressing it will perform an upgrade.
  327. .IP \(bu 2
  328. To force an upgrade from the command line, run \fBsyncthing \-upgrade\fP\&.
  329. .UNINDENT
  330. .sp
  331. Note that your system should have CA certificates installed which allow a
  332. secure connection to GitHub (e.g. FreeBSD requires \fBsudo pkg install
  333. ca_root_nss\fP). If \fBcurl\fP or \fBwget\fP works with normal HTTPS sites, then
  334. so should Syncthing.
  335. .SS Where do I find the latest release?
  336. .sp
  337. We release new versions through GitHub. The latest release is always found
  338. \fI\%on the release page\fP <\fBhttps://github.com/syncthing/syncthing/releases/latest\fP>\&. Unfortunately
  339. GitHub does not provide a single URL to automatically download the latest
  340. version. We suggest to use the GitHub API at
  341. \fI\%https://api.github.com/repos/syncthing/syncthing/releases/latest\fP and parsing
  342. the JSON response.
  343. .SH AUTHOR
  344. The Syncthing Authors
  345. .SH COPYRIGHT
  346. 2015, The Syncthing Authors
  347. .\" Generated by docutils manpage writer.
  348. .