Skip to content

Commit 3b89c1c

Browse files
authored
chore(syncthing): update command line flags, add env vars (#962)
Bringing it up to date with current. Changed H1 of the page to make more sense in web rendered format, the man renderer appears to ignore it anyway. Signed-off-by: Jakob Borg <[email protected]>
1 parent 1700e2c commit 3b89c1c

File tree

1 file changed

+58
-41
lines changed

1 file changed

+58
-41
lines changed

users/syncthing.rst

Lines changed: 58 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
.. _syncthing:
22
.. role:: strike
33

4-
Syncthing
5-
=========
4+
Command Line Operation
5+
======================
66

77
Synopsis
88
--------
@@ -17,10 +17,12 @@ Synopsis
1717
[--gui-address=<address>] [--gui-apikey=<key>]
1818
[--log-level=<level>] [--log-file=<filename>]
1919
[--log-max-old-files=<num>] [--log-max-size=<num>]
20+
[--log-format-timestamp=<format>] [--no-log-format-level-string]
21+
[--log-format-level-syslog]
2022
[--no-browser] [--no-console]
2123
[--no-port-probing] [--no-restart] [--no-upgrade]
2224
[--paused] [--unpaused]
23-
[--verbose] [--version] [--help] [--debug-*]
25+
[--version] [--help] [--debug-*]
2426

2527
syncthing cli
2628
[--home=<dir> | --config=<dir> --data=<dir>]
@@ -86,20 +88,20 @@ few log messages.
8688
Common options
8789
--------------
8890

89-
.. cmdoption:: --home=<dir>, -H <dir>
91+
.. cmdoption:: --home=<dir>, -H <dir> ($STHOMEDIR)
9092

9193
Set common configuration and data directory. The default configuration
9294
directory is ``$XDG_STATE_HOME/syncthing`` or
9395
``$HOME/.local/state/syncthing`` (Unix-like),
9496
``$HOME/Library/Application Support/Syncthing`` (Mac) and
9597
``%LOCALAPPDATA%\Syncthing`` (Windows).
9698

97-
.. cmdoption:: --config=<dir>, -C <dir>
99+
.. cmdoption:: --config=<dir>, -C <dir> ($STCONFDIR)
98100

99101
Set configuration directory. Alternative to ``--home`` and must be used
100102
together with ``--data``.
101103

102-
.. cmdoption:: --data=<dir>, -D <dir>
104+
.. cmdoption:: --data=<dir>, -D <dir> ($STDATADIR)
103105

104106
Set data (e.g. database) directory. Alternative to ``--home`` and must be used
105107
together with ``--config``.
@@ -112,31 +114,33 @@ Common options
112114
Serve options
113115
-------------
114116

115-
.. cmdoption:: --allow-newer-config
117+
.. cmdoption:: --allow-newer-config ($STALLOWNEWERCONFIG)
116118

117119
Try loading a config file written by a newer program version, instead of
118120
failing immediately.
119121

120-
.. cmdoption:: --audit
122+
.. cmdoption:: --audit ($STAUDIT)
121123

122124
Write events to timestamped file ``audit-YYYYMMDD-HHMMSS.log``.
123125

124-
.. cmdoption:: --auditfile=<file|-|-->
126+
.. cmdoption:: --auditfile=<file|-|--> ($STAUDITFILE)
125127

126128
Use specified file or stream (``"-"`` for stdout, ``"--"`` for stderr) for
127129
audit events, rather than the timestamped default file name.
128130

129-
.. cmdoption:: --db-maintenance-interval=<interval>
131+
.. cmdoption:: --db-maintenance-interval=<interval> ($STDBMAINTENANCEINTERVAL)
130132

131133
Database maintenance interval -- internal database maintenance routines
132-
run this often.
134+
run this often. The format is that of a Go duration string (see
135+
https://pkg.go.dev/time#ParseDuration).
133136

134-
.. cmdoption:: --db-delete-retention-interval=<interval>
137+
.. cmdoption:: --db-delete-retention-interval=<interval> ($STDBDELETERETENTIONINTERVAL)
135138

136139
Database deleted item retention interval -- deleted items are forgotten
137-
from the database after this interval.
140+
from the database after this interval. The format is that of a Go duration
141+
string (see https://pkg.go.dev/time#ParseDuration).
138142

139-
.. cmdoption:: --gui-address=<address>
143+
.. cmdoption:: --gui-address=<address> ($STGUIADDRESS)
140144

141145
Override GUI listen address. Set this to an address (``0.0.0.0:8384``)
142146
or a URL (``http://0.0.0.0:8384``). Supported schemes are ``http`` for
@@ -145,67 +149,80 @@ Serve options
145149
``unix:///run/syncthing/syncthing.socket`` (notice the three slashes: two
146150
as part of the URL structure, one to specify an absolute path).
147151

148-
.. cmdoption:: --gui-apikey=<string>
152+
.. cmdoption:: --gui-apikey=<string> ($STGUIAPIKEY)
149153

150154
Override the API key needed to access the GUI / REST API.
151155

152-
.. cmdoption:: --log-level=<level>
153-
154-
Set the log level for all packages. Valid levels are DEBUG, INFO, WARN,
155-
and ERROR.
156-
157-
.. cmdoption:: --log-file=<filename>
156+
.. cmdoption:: --log-file=<filename> ($STLOGFILE)
158157

159158
Set destination filename for logging (use ``"-"`` for stdout, which is the
160159
default option).
161160

162-
.. cmdoption:: --log-max-old-files=<num>
161+
.. cmdoption:: --log-level=<level> ($STLOGLEVEL)
162+
163+
Set the log level for all packages. Valid levels are DEBUG, INFO, WARN,
164+
and ERROR.
165+
166+
.. cmdoption:: --log-max-old-files=<num> ($STLOGMAXOLDFILES)
163167

164168
Number of old files to keep (zero to keep only current). Applies only when
165169
log rotation is enabled through ``--log-max-size``.
166170

167-
.. cmdoption:: --log-max-size=<num>
171+
.. cmdoption:: --log-max-size=<num> ($STLOGMAXSIZE)
172+
173+
Maximum size in bytes of any log file (zero to disable log rotation).
174+
175+
.. cmdoption:: --log-format-timestamp=<format> ($STLOGFORMATTIMESTAMP)
176+
177+
Format for timestamp, set to empty to disable timestamps. The format is that
178+
of the Go time formatter (see https://pkg.go.dev/time#Layout).
179+
180+
.. cmdoption:: --[no-]log-format-level-string ($STLOGFORMATLEVELSTRING)
181+
182+
Whether to include level string (e.g. "INF") in log line.
183+
184+
.. cmdoption:: --[no-]log-format-level-syslog ($STLOGFORMATLEVELSYSLOG)
168185

169-
Maximum size of any log file (zero to disable log rotation).
186+
Whether to include level as syslog prefix (e.g. "<6>") in log line.
170187

171-
.. cmdoption:: --no-browser
188+
.. cmdoption:: --no-browser ($STNOBROWSER)
172189

173190
Do not start a browser.
174191

175-
.. cmdoption:: --no-console
192+
.. cmdoption:: --no-console ($STNOCONSOLE)
176193

177194
Hide the console window. (On Windows only)
178195

179-
.. cmdoption:: --no-port-probing
196+
.. cmdoption:: --no-port-probing ($STNOPORTPROBING)
180197

181198
Don't try to find unused random ports for the GUI and listen address when
182199
generating an initial configuration / starting for the first time.
183200

184-
.. cmdoption:: --no-restart
201+
.. cmdoption:: --no-restart ($STNORESTART)
185202

186203
Do not restart Syncthing when it exits. The monitor process will still run
187204
to handle crashes and writing to logfiles (if configured to).
188205

189-
.. cmdoption:: --no-upgrade
206+
.. cmdoption:: --no-upgrade ($STNOUPGRADE)
190207

191-
Disable automatic upgrades. Equivalent to the ``STNOUPGRADE`` environment
192-
variable, see below.
208+
Disable automatic upgrades.
193209

194-
.. cmdoption:: --paused
210+
.. cmdoption:: --paused ($STPAUSED)
195211

196212
Start with all devices and folders paused.
197213

198-
.. cmdoption:: --unpaused
214+
.. cmdoption:: --unpaused ($STUNPAUSED)
199215

200216
Start with all devices and folders unpaused.
201217

202-
.. cmdoption:: --upgrade
218+
.. cmdoption:: --version
203219

204-
Perform upgrade.
220+
Show the current version information, then exit.
205221

206-
.. cmdoption:: --verbose
222+
.. cmdoption:: --debug-*
207223

208-
Print verbose log output.
224+
Several debug options exist. See ``syncthing serve --help`` for the flags
225+
that apply to your version.
209226

210227
Decrypt options
211228
---------------
@@ -218,7 +235,7 @@ Decrypt options
218235

219236
Don't write decrypted files to disk (but verify plaintext hashes).
220237

221-
.. cmdoption:: --password=<pw>
238+
.. cmdoption:: --password=<pw> ($FOLDER_PASSWORD)
222239

223240
Folder password for decryption / verification. Can be passed through the
224241
``FOLDER_PASSWORD`` environment variable instead to avoid recording in a
@@ -284,9 +301,9 @@ caused the process to exit. For example, ``128 + 9 (SIGKILL) = 137``.
284301
Subcommands
285302
-----------
286303

287-
The command line syntax actually supports different modes of operation through
288-
several subcommands, specified as the first argument. If omitted, the default
289-
``serve`` is assumed.
304+
The command line syntax supports different modes of operation through
305+
several subcommands, specified as the first argument. If omitted, the
306+
default ``serve`` is assumed.
290307

291308
The initial setup of a device ID and default configuration can be called
292309
explicitly with the ``generate`` subcommand. It can also update the configured

0 commit comments

Comments
 (0)