1SYNCTHING(1) Syncthing SYNCTHING(1)
2
3
4
6 syncthing - Syncthing
7
9 syncthing [-audit] [-auditfile=<file|-|-->] [-browser-only] [device-id]
10 [-generate=<dir>] [-gui-address=<address>] [-gui-apikey=<key>]
11 [-home=<dir> | -config=<dir> -data=<dir>]
12 [-logfile=<filename>] [-logflags=<flags>]
13 [-no-browser] [-no-console] [-no-restart] [-paths] [-paused]
14 [-reset-database] [-reset-deltas] [-unpaused] [-upgrade]
15 [-upgrade-check] [-upgrade-to=<url>] [-verbose] [-version]
16
18 Syncthing lets you synchronize your files bidirectionally across multi‐
19 ple devices. This means the creation, modification or deletion of files
20 on one machine will automatically be replicated to your other devices.
21 We believe your data is your data alone and you deserve to choose where
22 it is stored. Therefore Syncthing does not upload your data to the
23 cloud but exchanges your data across your machines as soon as they are
24 online at the same time.
25
26 The syncthing core application is a command-line program which usually
27 runs in the background and handles the synchronization. It provides a
28 built-in, HTML and JavaScript based user interface to be controlled
29 from a web browser. This frontend communicates with the core applica‐
30 tion through some HTTP APIs, which other apps like graphical system in‐
31 tegration helpers can use as well, for greatest flexibility. A link to
32 reach the GUI and API is printed among the first few log messages.
33
35 -audit Write events to timestamped file audit-YYYYMMDD-HHMMSS.log.
36
37 -auditfile=<file|-|-->
38 Use specified file or stream ("-" for stdout, "--" for stderr)
39 for audit events, rather than the timestamped default file name.
40
41 -browser-only
42 Open the web UI in a browser for an already running Syncthing
43 instance.
44
45 -device-id
46 Print device ID to command line.
47
48 -generate=<dir>
49 Generate key and config in specified dir, then exit.
50
51 -gui-address=<address>
52 Override GUI listen address. Set this to an address
53 (0.0.0.0:8384) or file path (/var/run/st.sock, for UNIX sock‐
54 ets).
55
56 -home=<dir>
57 Set common configuration and data directory. The default config‐
58 uration directory is $HOME/.config/syncthing (Unix-like),
59 $HOME/Library/Application Support/Syncthing (Mac) and %LOCALAPP‐
60 DATA%\Syncthing (Windows).
61
62 -config=<dir>
63 Set configuration directory. Alternative to -home and must be
64 used together with -data.
65
66 -data=<dir>
67 Set data (e.g. database) directory. Alternative to -home and
68 must be used together with -config.
69
70 -logfile=<filename>
71 Set destination filename for logging (use "-" for stdout, which
72 is the default option).
73
74 -logflags=<flags>
75 Select information in log line prefix. The -logflags value is a
76 sum of the following:
77
78 • 1: Date
79
80 • 2: Time
81
82 • 4: Microsecond time
83
84 • 8: Long filename
85
86 • 16: Short filename
87
88 To prefix each log line with date and time, set -logflags=3 (1 +
89 2 from above). The value 0 is used to disable all of the above.
90 The default is to show time only (2).
91
92 -no-browser
93 Do not start a browser.
94
95 -no-console
96 Hide the console window. (On Windows only)
97
98 -no-restart
99 Do not restart Syncthing when it exits. The monitor process will
100 still run to handle crashes and writing to logfiles (if config‐
101 ured to).
102
103 -paths Print the paths used for configuration, keys, database, GUI
104 overrides, default sync folder and the log file.
105
106 -paused
107 Start with all devices and folders paused.
108
109 -reset-database
110 Reset the database, forcing a full rescan and resync. Create
111 .stfolder folders in each sync folder if they do not already ex‐
112 ist. Caution: Ensure that all sync folders which are mountpoints
113 are already mounted. Inconsistent versions may result if the
114 mountpoint is later mounted and contains older versions.
115
116 -reset-deltas
117 Reset delta index IDs, forcing a full index exchange.
118
119 -unpaused
120 Start with all devices and folders unpaused.
121
122 -upgrade
123 Perform upgrade.
124
125 -upgrade-check
126 Check for available upgrade.
127
128 -upgrade-to=<url>
129 Force upgrade directly from specified URL.
130
131 -verbose
132 Print verbose log output.
133
134 -version
135 Show version.
136
138 0 Success / Shutdown
139
140 1 Error
141
142 2 Upgrade not available
143
144 3 Restarting
145
146 4 Upgrading
147
148 Exit codes over 125 are usually returned by the shell/binary loader/de‐
149 fault signal handler. Exit codes over 128+N on Unix usually represent
150 the signal which caused the process to exit. For example, 128 + 9
151 (SIGKILL) = 137.
152
154 Syncthing can use a SOCKS, HTTP, or HTTPS proxy to talk to the outside
155 world. The proxy is used for outgoing connections only - it is not pos‐
156 sible to accept incoming connections through the proxy. The proxy is
157 configured through the environment variable all_proxy. Somewhat unusu‐
158 ally, this variable must be named in lower case - it is not
159 “ALL_PROXY”. For example:
160
161 $ export all_proxy=socks://192.0.2.42:8081
162
164 The following environment variables modify Syncthing’s behavior in ways
165 that are mostly useful for developers. Use with care. If you start
166 Syncthing from within service managers like systemd or supervisor, path
167 expansion may not be supported.
168
169 STTRACE
170 Used to increase the debugging verbosity in specific or all fa‐
171 cilities, generally mapping to a Go package. Enabling any of
172 these also enables microsecond timestamps, file names plus line
173 numbers. Enter a comma-separated string of facilities to trace.
174 syncthing -help always outputs an up-to-date list. The valid fa‐
175 cility strings are:
176
177 Main and operational facilities:
178
179 config Configuration loading and saving.
180
181 db The database layer.
182
183 main Main package.
184
185 model The root hub; the largest chunk of the system.
186 File pulling, index transmission and requests for
187 chunks.
188
189 scanner
190 File change detection and hashing.
191
192 versioner
193 File versioning.
194
195 Networking facilities:
196
197 beacon Multicast and broadcast UDP discovery packets: Se‐
198 lected interfaces and addresses.
199
200 connections
201 Connection handling.
202
203 dialer Dialing connections.
204
205 discover
206 Remote device discovery requests, replies and reg‐
207 istration of devices.
208
209 nat NAT discovery and port mapping.
210
211 pmp NAT-PMP discovery and port mapping.
212
213 protocol
214 The BEP protocol.
215
216 relay Relay interaction (strelaysrv).
217
218 upnp UPnP discovery and port mapping.
219
220 Other facilities:
221
222 fs Filesystem access.
223
224 events Event generation and logging.
225
226 http REST API.
227
228 sha256 SHA256 hashing package (this facility currently
229 unused).
230
231 stats Persistent device and folder statistics.
232
233 sync Mutexes. Used for debugging race conditions and
234 deadlocks.
235
236 upgrade
237 Binary upgrades.
238
239 walkfs Filesystem access while walking.
240
241 all All of the above.
242
243 STBLOCKPROFILE
244 Write block profiles to block-$pid-$timestamp.pprof every 20
245 seconds.
246
247 STCPUPROFILE
248 Write a CPU profile to cpu-$pid.pprof on exit.
249
250 STDEADLOCKTIMEOUT
251 Used for debugging internal deadlocks; sets debug sensitivity.
252 Use only under direction of a developer.
253
254 STDEADLOCKTHRESHOLD
255 Used for debugging internal deadlocks; sets debug sensitivity.
256 Use only under direction of a developer.
257
258 STGUIASSETS
259 Directory to load GUI assets from. Overrides compiled in assets.
260 Useful for developing webgui, commonly use STGUIASSETS=gui
261 bin/syncthing.
262
263 STHASHING
264 Specify which hashing package to use. Defaults to automatic
265 based on performance. Specify “minio” (compatibility) or “stan‐
266 dard” for the default Go implementation.
267
268 STHEAPPROFILE
269 Write heap profiles to heap-$pid-$timestamp.pprof each time heap
270 usage increases.
271
272 STNODEFAULTFOLDER
273 Don’t create a default folder when starting for the first time.
274 This variable will be ignored anytime after the first run.
275
276 STNORESTART
277 Equivalent to the -no-restart flag
278
279 STNOUPGRADE
280 Disable automatic upgrades.
281
282 STPROFILER
283 Set to a listen address such as “127.0.0.1:9090” to start the
284 profiler with HTTP access, which then can be reached at
285 http://localhost:9090/debug/pprof. See go tool pprof for more
286 information.
287
288 STPERFSTATS
289 Write running performance statistics to perf-$pid.csv. Not sup‐
290 ported on Windows.
291
292 STRECHECKDBEVERY
293 Time before folder statistics (file, dir, … counts) are recalcu‐
294 lated from scratch. The given duration must be parseable by Go’s
295 time.ParseDuration. If missing or not parseable, the default
296 value of 1 month is used. To force recalculation on every
297 startup, set it to 1s.
298
299 GOMAXPROCS
300 Set the maximum number of CPU cores to use. Defaults to all
301 available CPU cores.
302
303 GOGC Percentage of heap growth at which to trigger GC. Default is
304 100. Lower numbers keep peak memory usage down, at the price of
305 CPU usage (i.e. performance).
306
308 syncthing-config(5), syncthing-stignore(5), syncthing-device-ids(7),
309 syncthing-security(7), syncthing-networking(7), syncthing-version‐
310 ing(7), syncthing-faq(7)
311
313 The Syncthing Authors
314
316 2014-2019, The Syncthing Authors
317
318
319
320
321v1 Oct 17, 2021 SYNCTHING(1)