Syncthing lets you synchronize your files bidirectionally across multiple
devices. This means the creation, modification or deletion of files on one
machine will automatically be replicated to your other devices. We believe your
data is your data alone and you deserve to choose where it is stored. Therefore
Syncthing does not upload your data to the cloud but exchanges your data across
your machines as soon as they are online at the same time.
.SHOPTIONS
.INDENT0.0
.TP
.B\-audit
Write events to timestamped file \fBaudit\-YYYYMMDD\-HHMMSS.log\fP\&.
.UNINDENT
.INDENT0.0
.TP
.B\-auditfile=<file|\-|\-\->
Use specified file or stream (\fB"\-"\fP for stdout, \fB"\-\-"\fP for stderr) for audit events, rather than the timestamped default file name.
.UNINDENT
.INDENT0.0
.TP
.B\-browser\-only
Open the web UI in a browser for an already running Syncthing instance.
.UNINDENT
.INDENT0.0
.TP
.B\-device\-id
Print device ID to command line.
.UNINDENT
.INDENT0.0
.TP
.B\-generate=<dir>
Generate key and config in specified dir, then exit.
.UNINDENT
.INDENT0.0
.TP
.B\-gui\-address=<address>
Override GUI listen address. Set this to an address (\fB0.0.0.0:8384\fP)
or file path (\fB/var/run/st.sock\fP, for UNIX sockets).
.UNINDENT
.INDENT0.0
.TP
.B\-home=<dir>
Set configuration directory. The default configuration directory is
\fB$HOME/.config/syncthing\fP (Unix\-like), \fB$HOME/Library/Application Support/Syncthing\fP (Mac) and \fB%LOCALAPPDATA%\eSyncthing\fP (Windows).
.UNINDENT
.INDENT0.0
.TP
.B\-logfile=<filename>
Set destination filename for logging (use \fB"\-"\fP for stdout, which is the default option).
.UNINDENT
.INDENT0.0
.TP
.B\-logflags=<flags>
Select information in log line prefix. The \fB\-logflags\fP value is a sum of
the following:
.INDENT7.0
.IP\(bu2
1: Date
.IP\(bu2
2: Time
.IP\(bu2
4: Microsecond time
.IP\(bu2
8: Long filename
.IP\(bu2
16: Short filename
.UNINDENT
.sp
To prefix each log line with date and time, set \fB\-logflags=3\fP (1 + 2 from
above). The value 0 is used to disable all of the above. The default is to
show time only (2).
.UNINDENT
.INDENT0.0
.TP
.B\-no\-browser
Do not start a browser.
.UNINDENT
.INDENT0.0
.TP
.B\-no\-console
Hide the console window. (On Windows only)
.UNINDENT
.INDENT0.0
.TP
.B\-no\-restart
Disable the Syncthing monitor process which handles restarts for some configuration changes, upgrades, crashes and also log file writing (stdout is still written).
.UNINDENT
.INDENT0.0
.TP
.B\-paths
Print the paths used for configuration, keys, database, GUI overrides, default sync folder and the log file.
.UNINDENT
.INDENT0.0
.TP
.B\-paused
Start with all devices and folders paused.
.UNINDENT
.INDENT0.0
.TP
.B\-reset\-database
Reset the database, forcing a full rescan and resync. Create \fI\&.stfolder\fP
folders in each sync folder if they do not already exist. \fBCaution\fP:
Ensure that all sync folders which are mountpoints are already mounted.
Inconsistent versions may result if the mountpoint is later mounted and
contains older versions.
.UNINDENT
.INDENT0.0
.TP
.B\-reset\-deltas
Reset delta index IDs, forcing a full index exchange.
.UNINDENT
.INDENT0.0
.TP
.B\-unpaused
Start with all devices and folders unpaused.
.UNINDENT
.INDENT0.0
.TP
.B\-upgrade
Perform upgrade.
.UNINDENT
.INDENT0.0
.TP
.B\-upgrade\-check
Check for available upgrade.
.UNINDENT
.INDENT0.0
.TP
.B\-upgrade\-to=<url>
Force upgrade directly from specified URL.
.UNINDENT
.INDENT0.0
.TP
.B\-verbose
Print verbose log output.
.UNINDENT
.INDENT0.0
.TP
.B\-version
Show version.
.UNINDENT
.SHEXITCODES
.INDENT0.0
.TP
.B0
Success / Shutdown
.TP
.B1
Error
.TP
.B2
Upgrade not available
.TP
.B3
Restarting
.TP
.B4
Upgrading
.UNINDENT
.sp
Some of these exit codes are only returned when running without a monitor
process (with environment variable \fBSTNORESTART\fP set). Exit codes over 125 are
usually returned by the shell/binary loader/default signal handler. Exit codes
over 128+N on Unix usually represent the signal which caused the process to
exit. For example, \fB128 + 9 (SIGKILL) = 137\fP\&.
.SHPROXIES
.sp
Syncthing can use a SOCKS, HTTP, or HTTPS proxy to talk to the outside
world. The proxy is used for outgoing connections only \- it is not possible
to accept incoming connections through the proxy. The proxy is configured
through the environment variable \fBall_proxy\fP\&. Somewhat unusually, this
variable must be named in lower case \- it is not “ALL_PROXY”. For
example:
.INDENT0.0
.INDENT3.5
.sp
.nf
.ftC
$ export all_proxy=socks://192.0.2.42:8081
.ftP
.fi
.UNINDENT
.UNINDENT
.SHDEVELOPMENTSETTINGS
.sp
The following environment variables modify Syncthing’s behavior in ways that
are mostly useful for developers. Use with care.
If you start Syncthing from within service managers like systemd or supervisor,
path expansion may not be supported.
.INDENT0.0
.TP
.BSTTRACE
Used to increase the debugging verbosity in specific or all facilities,
generally mapping to a Go package. Enabling any of these also enables
microsecond timestamps, file names plus line numbers. Enter a
comma\-separated string of facilities to trace. \fBsyncthing \-help\fP always
outputs an up\-to\-date list. The valid facility strings are:
.INDENT7.0
.TP
.BMainandoperationalfacilities:
.INDENT7.0
.TP
.Bconfig
Configuration loading and saving.
.TP
.Bdb
The database layer.
.TP
.Bmain
Main package.
.TP
.Bmodel
The root hub; the largest chunk of the system. File pulling, index
transmission and requests for chunks.
.TP
.Bscanner
File change detection and hashing.
.TP
.Bversioner
File versioning.
.UNINDENT
.TP
.BNetworkingfacilities:
.INDENT7.0
.TP
.Bbeacon
Multicast and broadcast UDP discovery packets: Selected interfaces
and addresses.
.TP
.Bconnections
Connection handling.
.TP
.Bdialer
Dialing connections.
.TP
.Bdiscover
Remote device discovery requests, replies and registration of
devices.
.TP
.Bnat
NAT discovery and port mapping.
.TP
.Bpmp
NAT\-PMP discovery and port mapping.
.TP
.Bprotocol
The BEP protocol.
.TP
.Brelay
Relay interaction (\fBstrelaysrv\fP).
.TP
.Bupnp
UPnP discovery and port mapping.
.UNINDENT
.TP
.BOtherfacilities:
.INDENT7.0
.TP
.Bfs
Filesystem access.
.TP
.Bevents
Event generation and logging.
.TP
.Bhttp
REST API.
.TP
.Bsha256
SHA256 hashing package (this facility currently unused).
.TP
.Bstats
Persistent device and folder statistics.
.TP
.Bsync
Mutexes. Used for debugging race conditions and deadlocks.
.TP
.Bupgrade
Binary upgrades.
.TP
.Bwalkfs
Filesystem access while walking.
.TP
.Ball
All of the above.
.UNINDENT
.UNINDENT
.TP
.BSTBLOCKPROFILE
Write block profiles to \fBblock\-$pid\-$timestamp.pprof\fP every 20 seconds.
.TP
.BSTCPUPROFILE
Write a CPU profile to \fBcpu\-$pid.pprof\fP on exit.
.TP
.BSTDEADLOCKTIMEOUT
Used for debugging internal deadlocks; sets debug sensitivity. Use only
under direction of a developer.
.TP
.BSTDEADLOCKTHRESHOLD
Used for debugging internal deadlocks; sets debug sensitivity. Use only
under direction of a developer.
.TP
.BSTGUIASSETS
Directory to load GUI assets from. Overrides compiled in assets. Useful for
developing webgui, commonly use \fBSTGUIASSETS=gui bin/syncthing\fP\&.
.TP
.BSTHASHING
Specify which hashing package to use. Defaults to automatic based on
performance. Specify “minio” (compatibility) or “standard” for the default
Go implementation.
.TP
.BSTHEAPPROFILE
Write heap profiles to \fBheap\-$pid\-$timestamp.pprof\fP each time heap usage
increases.
.TP
.BSTNODEFAULTFOLDER
Don’t create a default folder when starting for the first time. This
variable will be ignored anytime after the first run.
.TP
.BSTNORESTART
Equivalent to the \fB\-no\-restart\fP flag. Disable the Syncthing monitor
process which handles restarts for some configuration changes, upgrades,
crashes and also log file writing (stdout is still written).
.TP
.BSTNOUPGRADE
Disable automatic upgrades.
.TP
.BSTPROFILER
Set to a listen address such as “127.0.0.1:9090” to start the profiler with
HTTP access, which then can be reached at
\fI\%http://localhost:9090/debug/pprof\fP\&. See \fBgo tool pprof\fP for more
information.
.TP
.BSTPERFSTATS
Write running performance statistics to \fBperf\-$pid.csv\fP\&. Not supported on
Windows.
.TP
.BSTRECHECKDBEVERY
Time before folder statistics (file, dir, … counts) are recalculated from
scratch. The given duration must be parseable by Go’s time.ParseDuration. If
missing or not parseable, the default value of 1 month is used. To force
recalculation on every startup, set it to \fB1s\fP\&.
.TP
.BGOMAXPROCS
Set the maximum number of CPU cores to use. Defaults to all available CPU
cores.
.TP
.BGOGC
Percentage of heap growth at which to trigger GC. Default is 100. Lower
numbers keep peak memory usage down, at the price of CPU usage