syncthing-faq.7 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475
  1. .\" Man page generated from reStructuredText.
  2. .
  3. .TH "SYNCTHING-FAQ" "7" "February 22, 2017" "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/Resilio Sync?
  49. .sp
  50. The two are different and not related. Syncthing and BitTorrent/Resilio Sync accomplish
  51. some of the same things, namely syncing files between two or more computers.
  52. .sp
  53. BitTorrent Sync, now called Resilio Sync, 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. Resilio
  60. Sync uses an undocumented, closed protocol with unknown security properties.
  61. .IP [1] 5
  62. \fI\%https://en.wikipedia.org/wiki/Resilio_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 (Except on Windows.)
  81. .UNINDENT
  82. .sp
  83. The following are \fInot\fP synchronized;
  84. .INDENT 0.0
  85. .IP \(bu 2
  86. File or Directory Owners and Groups (not preserved)
  87. .IP \(bu 2
  88. Directory Modification Times (not preserved)
  89. .IP \(bu 2
  90. Hard Links (followed, not preserved)
  91. .IP \(bu 2
  92. Extended Attributes, Resource Forks (not preserved)
  93. .IP \(bu 2
  94. Windows, POSIX or NFS ACLs (not preserved)
  95. .IP \(bu 2
  96. Devices, FIFOs, and Other Specials (ignored)
  97. .IP \(bu 2
  98. Sparse file sparseness (will become sparse, when supported by the OS & filesystem)
  99. .UNINDENT
  100. .SS Is synchronization fast?
  101. .sp
  102. Syncthing segments files into pieces, called blocks, to transfer data from one
  103. device to another. Therefore, multiple devices can share the synchronization
  104. load, in a similar way to the torrent protocol. The more devices you have online,
  105. the faster an additional device will receive the data
  106. because small blocks will be fetched from all devices in parallel.
  107. .sp
  108. Syncthing handles renaming files and updating their metadata in an efficient
  109. manner. This means that renaming a large file will not cause a retransmission of
  110. that file. Additionally, appending data to existing large files should be
  111. handled efficiently as well.
  112. .sp
  113. Temporary files are used to store partial data downloaded from other devices.
  114. They are automatically removed whenever a file transfer has been completed or
  115. after the configured amount of time which is set in the configuration file (24
  116. hours by default).
  117. .SS Why is the sync so slow?
  118. .sp
  119. When troubleshooting a slow sync, there are a number of things to check.
  120. .sp
  121. First of all, verify that you are not connected via a relay. In the "Remote
  122. Devices" list on the right side of the GUI, double check that you see
  123. "Address: <some address>" and \fInot\fP "Relay: <some address>".
  124. [image]
  125. .sp
  126. If you are connected via a relay, this is because a direct connection could
  127. not be established. Double check and follow the suggestions in
  128. firewall\-setup to enable direct connections.
  129. .sp
  130. Second, if one of the devices is a very low powered machine (a Raspberry Pi,
  131. or a phone, or a NAS, or similar) you are likely constrained by the CPU on
  132. that device. See the next question for reasons Syncthing likes a faster CPU.
  133. You can verify this by looking at the CPU utilization in the GUI. If it is
  134. constantly at or close to 100%, you are limited by the CPU speed. In some
  135. cases a lower CPU usage number can also indicate being limited by the CPU \-
  136. for example constant 25% usage on a four core CPU likely means that
  137. Syncthing is doing something that is not parallellizable and thus limited to
  138. a single CPU core.
  139. .sp
  140. Third, verify that the network connection is OK. Tools such as iperf or just
  141. an Internet speed test can be used to verify the performance here.
  142. .SS Why does it use so much CPU?
  143. .INDENT 0.0
  144. .IP 1. 3
  145. When new or changed files are detected, or Syncthing starts for the
  146. first time, your files are hashed using SHA\-256.
  147. .IP 2. 3
  148. Data that is sent over the network is (optionally) compressed and
  149. encrypted using AES\-128. When receiving data, it must be decrypted.
  150. .IP 3. 3
  151. There is a certain amount of housekeeping that must be done to track the
  152. current and available versions of each file in the index database.
  153. .IP 4. 3
  154. By default Syncthing uses periodic scanning every 60 seconds to detect
  155. file changes. This means checking every file\(aqs modification time and
  156. comparing it to the database. This can cause spikes of CPU usage for large
  157. folders.
  158. .UNINDENT
  159. .sp
  160. Hashing, compression and encryption cost CPU time. Also, using the GUI
  161. causes a certain amount of extra CPU usage to calculate the summary data it
  162. presents. Note however that once things are \fIin sync\fP CPU usage should be
  163. negligible.
  164. .sp
  165. To limit the amount of CPU used when syncing and scanning, set the
  166. environment variable \fBGOMAXPROCS\fP to the maximum number of CPU cores
  167. Syncthing should use at any given moment. For example, \fBGOMAXPROCS=2\fP on a
  168. machine with four cores will limit Syncthing to no more than half the
  169. system\(aqs CPU power.
  170. .sp
  171. To reduce CPU spikes from scanning activity, use a filesystem notifications
  172. plugin. This is delivered by default via Synctrayzor, Syncthing\-GTK and on
  173. Android. For other setups, consider using \fI\%syncthing\-inotify\fP <\fBhttps://github.com/syncthing/syncthing-inotify\fP>\&.
  174. .SS Should I keep my device IDs secret?
  175. .sp
  176. No. The IDs are not sensitive. Given a device ID it\(aqs possible to find the IP
  177. address for that device, if global discovery is enabled on it. Knowing the device
  178. ID doesn\(aqt help you actually establish a connection to that device or get a list
  179. of files, etc.
  180. .sp
  181. For a connection to be established, both devices need to know about the other\(aqs
  182. device ID. It\(aqs not possible (in practice) to forge a device ID. (To forge a
  183. device ID you need to create a TLS certificate with that specific SHA\-256 hash.
  184. If you can do that, you can spoof any TLS certificate. The world is your
  185. oyster!)
  186. .sp
  187. \fBSEE ALSO:\fP
  188. .INDENT 0.0
  189. .INDENT 3.5
  190. device\-ids
  191. .UNINDENT
  192. .UNINDENT
  193. .SS What if there is a conflict?
  194. .sp
  195. Syncthing does recognize conflicts. When a file has been modified on two devices
  196. simultaneously and the content actually differs, one of the files will be
  197. renamed to \fB<filename>.sync\-conflict\-<date>\-<time>.<ext>\fP\&. The file with the
  198. older modification time will be marked as the conflicting file and thus be
  199. renamed. If the modification times are equal, the file originating from the
  200. device which has the larger value of the first 63 bits for his device ID will be
  201. marked as the conflicting file.
  202. If the conflict is between a modification and a deletion of the file, the
  203. modified file always wins and is resurrected without renaming on the
  204. device where it was deleted.
  205. .sp
  206. Beware that the \fB<filename>.sync\-conflict\-<date>\-<time>.<ext>\fP files are
  207. treated as normal files after they are created, so they are propagated between
  208. devices. We do this because the conflict is detected and resolved on one device,
  209. creating the \fBsync\-conflict\fP file, but it\(aqs just as much of a conflict
  210. everywhere else and we don\(aqt know which of the conflicting files is the "best"
  211. from the user point of view. Moreover, if there\(aqs something that automatically
  212. causes a conflict on change you\(aqll end up with \fBsync\-conflict\-...sync\-conflict
  213. \-...\-sync\-conflict\fP files.
  214. .SS Am I able to use nested Syncthing folders?
  215. .sp
  216. Do not nest shared folders. This behaviour is in no way supported,
  217. recommended or coded for in any way, and comes with many pitfalls.
  218. .SS How do I rename/move a synced folder?
  219. .sp
  220. Syncthing doesn\(aqt have a direct way to do this, as it\(aqs potentially
  221. dangerous to do so if you\(aqre not careful \- it may result in data loss if
  222. something goes wrong during the move and is synchronized to your other
  223. devices.
  224. .sp
  225. The easy way to rename or move a synced folder on the local system is to
  226. remove the folder in the Syncthing UI, move it on disk, then re\-add it using
  227. the new path.
  228. .sp
  229. It\(aqs best to do this when the folder is already in sync between your
  230. devices, as it is otherwise unpredictable which changes will "win" after the
  231. move. Changes made on other devices may be overwritten, or changes made
  232. locally may be overwritten by those on other devices.
  233. .sp
  234. An alternative way is to shut down Syncthing, move the folder on disk, edit
  235. the path directly in the configuration file and then start Syncthing again.
  236. .SS How do I configure multiple users on a single machine?
  237. .sp
  238. Each user should run their own Syncthing instance. Be aware that you might need
  239. to configure listening ports such that they do not overlap (see config).
  240. .SS Does Syncthing support syncing between folders on the same system?
  241. .sp
  242. No. Syncthing is not designed to sync locally and the overhead involved in
  243. doing so using Syncthing\(aqs method would be wasteful. There are better
  244. programs to achieve this such as rsync or Unison.
  245. .SS When I do have two distinct Syncthing\-managed folders on two hosts, how does Syncthing handle moving files between them?
  246. .sp
  247. Syncthing does not specially handle this case, and most files most likely get
  248. re\-downloaded.
  249. .sp
  250. In detail, the behavior depends on the scan order. If you have folder A and B,
  251. and move files from A to B, if A gets scanned first, it will announce removal of
  252. the files to others who will remove the files. As you rescan B, B will
  253. announce addition of new files, and other peers will have nowhere to get
  254. them from apart from re\-downloading them.
  255. .sp
  256. If B gets rescanned first, B will announce additions first, remote
  257. peers will reconstruct the files (not rename, more like copy block by
  258. block) from A, and then as A gets rescanned remove the files from A.
  259. .sp
  260. A workaround would be to copy first from A to B, rescan B, wait for B to
  261. rebuild on remote ends, and then delete from A.
  262. .SS Is Syncthing my ideal backup application?
  263. .sp
  264. No. Syncthing is not a great backup application because all changes to your
  265. files (modifications, deletions, etc.) will be propagated to all your
  266. devices. You can enable versioning, but we encourage the use of other tools
  267. to keep your data safe from your (or our) mistakes.
  268. .SS Why is there no iOS client?
  269. .sp
  270. There is an alternative implementation of Syncthing (using the same network
  271. protocol) called \fBfsync()\fP\&. There are no plans by the current Syncthing
  272. team to support iOS in the foreseeable future, as the code required to do so
  273. would be quite different from what Syncthing is today.
  274. .SS How can I exclude files with brackets (\fB[]\fP) in the name?
  275. .sp
  276. The patterns in .stignore are glob patterns, where brackets are used to
  277. denote character ranges. That is, the pattern \fBq[abc]x\fP will match the
  278. files \fBqax\fP, \fBqbx\fP and \fBqcx\fP\&.
  279. .sp
  280. To match an actual file \fIcalled\fP \fBq[abc]x\fP the pattern needs to "escape"
  281. the brackets, like so: \fBq\e[abc\e]x\fP\&.
  282. .sp
  283. On Windows, escaping special characters is not supported as the \fB\e\fP
  284. character is used as a path separator. On the other hand, special characters
  285. such as \fB[\fP and \fB?\fP are not allowed in file names on Windows.
  286. .SS Why is the setup more complicated than BitTorrent/Resilio Sync?
  287. .sp
  288. Security over convenience. In Syncthing you have to setup both sides to
  289. connect two devices. An attacker can\(aqt do much with a stolen device ID, because
  290. you have to add the device on the other side too. You have better control
  291. where your files are transferred.
  292. .sp
  293. This is an area that we are working to improve in the long term.
  294. .SS How do I access the web GUI from another computer?
  295. .sp
  296. The default listening address is 127.0.0.1:8384, so you can only access the
  297. GUI from the same machine. This is for security reasons. Change the \fBGUI
  298. listen address\fP through the web UI from \fB127.0.0.1:8384\fP to
  299. \fB0.0.0.0:8384\fP or change the config.xml:
  300. .INDENT 0.0
  301. .INDENT 3.5
  302. .sp
  303. .nf
  304. .ft C
  305. <gui enabled="true" tls="false">
  306. <address>127.0.0.1:8384</address>
  307. .ft P
  308. .fi
  309. .UNINDENT
  310. .UNINDENT
  311. .sp
  312. to
  313. .INDENT 0.0
  314. .INDENT 3.5
  315. .sp
  316. .nf
  317. .ft C
  318. <gui enabled="true" tls="false">
  319. <address>0.0.0.0:8384</address>
  320. .ft P
  321. .fi
  322. .UNINDENT
  323. .UNINDENT
  324. .sp
  325. Then the GUI is accessible from everywhere. You should set a password and
  326. enable HTTPS with this configuration. You can do this from inside the GUI.
  327. .sp
  328. If both your computers are Unix\-like (Linux, Mac, etc.) you can also leave the
  329. GUI settings at default and use an ssh port forward to access it. For
  330. example,
  331. .INDENT 0.0
  332. .INDENT 3.5
  333. .sp
  334. .nf
  335. .ft C
  336. $ ssh \-L 9090:127.0.0.1:8384 [email protected]
  337. .ft P
  338. .fi
  339. .UNINDENT
  340. .UNINDENT
  341. .sp
  342. will log you into othercomputer.example.com, and present the \fIremote\fP
  343. Syncthing GUI on \fI\%http://localhost:9090\fP on your \fIlocal\fP computer.
  344. .sp
  345. If you only want to access the remote gui and don\(aqt want the terminal
  346. session, use this example,
  347. .INDENT 0.0
  348. .INDENT 3.5
  349. .sp
  350. .nf
  351. .ft C
  352. $ ssh \-N \-L 9090:127.0.0.1:8384 [email protected]
  353. .ft P
  354. .fi
  355. .UNINDENT
  356. .UNINDENT
  357. .sp
  358. If only your remote computer is Unix\-like,
  359. you can still access it with ssh from Windows.
  360. .sp
  361. Under Windows 10 (64 bit) you can use the same ssh command if you install
  362. the Windows Subsystem for Linux.
  363. \fI\%https://msdn.microsoft.com/en\-gb/commandline/wsl/install_guide\fP
  364. .sp
  365. Another Windows way to run ssh is to install gow.
  366. (Gnu On Windows) \fI\%https://github.com/bmatzelle/gow\fP
  367. .sp
  368. The easiest way to install gow is with chocolatey.
  369. \fI\%https://chocolatey.org/\fP
  370. .SS Why do I get "Host check error" in the GUI/API?
  371. .sp
  372. Since version 0.14.6 Syncthing does an extra security check when the GUI/API
  373. is bound to localhost \- namely that the browser is talking to localhost.
  374. This protects against most forms of \fI\%DNS rebinding attack\fP <\fBhttps://en.wikipedia.org/wiki/DNS_rebinding\fP> against the GUI.
  375. .sp
  376. To pass this test, ensure that you are accessing the GUI using an URL that
  377. begins with \fIhttp://localhost\fP, \fIhttp://127.0.0.1\fP or \fIhttp://[::1]\fP\&. HTTPS
  378. is fine too, of course.
  379. .sp
  380. If you are using a proxy in front of Syncthing you may need to disable this
  381. check, after ensuring that the proxy provides sufficient authentication to
  382. protect against unauthorized access. Either:
  383. .INDENT 0.0
  384. .IP \(bu 2
  385. Make sure the proxy sets a \fIHost\fP header containing \fIlocalhost\fP, or
  386. .IP \(bu 2
  387. Set \fIinsecureSkipHostcheck\fP in the advanced settings, or
  388. .IP \(bu 2
  389. Bind the GUI/API to a non\-localhost listen port.
  390. .UNINDENT
  391. .sp
  392. In all cases, username/password authentication and HTTPS should be used.
  393. .SS My Syncthing database is corrupt
  394. .sp
  395. This is almost always a result of bad RAM, storage device or other hardware. When the index database is found to be corrupt Syncthing cannot operate and will note this in the logs and exit. To overcome this delete the \fI\%database folder\fP <\fBhttps://docs.syncthing.net/users/config.html#description\fP> inside Syncthing\(aqs home directory and re\-start Syncthing. It will then need to perform a full re\-hashing of all shared folders. You should check your system in case the underlying cause is indeed faulty hardware which may put the system at risk of further data loss.
  396. .SS I don\(aqt like the GUI or the theme. Can it be changed?
  397. .sp
  398. You can change the theme in the settings. Syncthing ships with other themes
  399. than the default.
  400. .sp
  401. If you want a custom theme or a completely different GUI, you can add your
  402. own.
  403. By default, Syncthing will look for a directory \fBgui\fP inside the Syncthing
  404. home folder. To change the directory to look for themes, you need to set the
  405. STGUIASSETS environment variable. To get the concrete directory, run
  406. syncthing with the \fB\-paths\fP parameter. It will print all the relevant paths,
  407. including the "GUI override directory".
  408. .sp
  409. To add e.g. a red theme, you can create the file \fBred/assets/css/theme.css\fP
  410. inside the GUI override directory to override the default CSS styles.
  411. .sp
  412. To create a whole new GUI, you should checkout the files at
  413. \fI\%https://github.com/syncthing/syncthing/tree/master/gui/default\fP
  414. to get an idea how to do that.
  415. .SS Why do I see Syncthing twice in task manager?
  416. .sp
  417. One process manages the other, to capture logs and manage restarts. This
  418. makes it easier to handle upgrades from within Syncthing itself, and also
  419. ensures that we get a nice log file to help us narrow down the cause for
  420. crashes and other bugs.
  421. .SS Where do Syncthing logs go to?
  422. .sp
  423. Syncthing logs to stdout by default. On Windows Syncthing by default also
  424. creates \fBsyncthing.log\fP in Syncthing\(aqs home directory (run \fBsyncthing
  425. \-paths\fP to see where that is). Command line option \fB\-logfile\fP can be used
  426. to specify a user\-defined logfile.
  427. .SS How do I upgrade Syncthing?
  428. .sp
  429. If you use a package manager such as Debian\(aqs apt\-get, you should upgrade
  430. using the package manager. If you use the binary packages linked from
  431. Syncthing.net, you can use Syncthing built in automatic upgrades.
  432. .INDENT 0.0
  433. .IP \(bu 2
  434. If automatic upgrades is enabled (which is the default), Syncthing will
  435. upgrade itself automatically within 24 hours of a new release.
  436. .IP \(bu 2
  437. The upgrade button appears in the web GUI when a new version has been
  438. released. Pressing it will perform an upgrade.
  439. .IP \(bu 2
  440. To force an upgrade from the command line, run \fBsyncthing \-upgrade\fP\&.
  441. .UNINDENT
  442. .sp
  443. Note that your system should have CA certificates installed which allow a
  444. secure connection to GitHub (e.g. FreeBSD requires \fBsudo pkg install
  445. ca_root_nss\fP). If \fBcurl\fP or \fBwget\fP works with normal HTTPS sites, then
  446. so should Syncthing.
  447. .SS Where do I find the latest release?
  448. .sp
  449. We release new versions through GitHub. The latest release is always found
  450. \fI\%on the release page\fP <\fBhttps://github.com/syncthing/syncthing/releases/latest\fP>\&. Unfortunately
  451. GitHub does not provide a single URL to automatically download the latest
  452. version. We suggest to use the GitHub API at
  453. \fI\%https://api.github.com/repos/syncthing/syncthing/releases/latest\fP and parsing
  454. the JSON response.
  455. .SS How do I run Syncthing as a daemon process on Linux?
  456. .sp
  457. If you\(aqre using systemd, runit, or upstart, we already ship examples, check
  458. \fI\%https://github.com/syncthing/syncthing/tree/master/etc\fP for example
  459. configurations.
  460. .sp
  461. If however you\(aqre not using one of these tools, you have a couple of options.
  462. If your system has a tool called \fBstart\-stop\-daemon\fP installed (that\(aqs the name
  463. of the command, not the package), look into the local documentation for that, it
  464. will almost certainly cover 100% of what you want to do. If you don\(aqt have
  465. \fBstart\-stop\-daemon\fP, there are a bunch of other software packages you could use
  466. to do this. The most well known is called daemontools, and can be found in the
  467. standard package repositories for almost every modern Linux distribution.
  468. Other popular tools with similar functionality include S6 and the aforementioned
  469. runit.
  470. .SH AUTHOR
  471. The Syncthing Authors
  472. .SH COPYRIGHT
  473. 2015, The Syncthing Authors
  474. .\" Generated by docutils manpage writer.
  475. .