SYNCTHING(1)                       Syncthing                      SYNCTHING(1)



NNAAMMEE
       syncthing - Syncthing

SSYYNNOOPPSSIISS
          syncthing [serve]
                    [--audit] [--auditfile=<file|-|-->] [--browser-only] [--device-id]
                    [--generate=<dir>] [--gui-address=<address>] [--gui-apikey=<key>]
                    [--home=<dir> | --config=<dir> --data=<dir>]
                    [--logfile=<filename>] [--logflags=<flags>]
                    [--log-max-old-files=<num>] [--log-max-size=<num>]
                    [--no-browser] [--no-console] [--no-restart] [--paths] [--paused]
                    [--no-default-folder] [--skip-port-probing]
                    [--reset-database] [--reset-deltas] [--unpaused] [--allow-newer-config]
                    [--upgrade] [--no-upgrade] [--upgrade-check] [--upgrade-to=<url>]
                    [--verbose] [--version] [--help] [--debug-*]

          syncthing generate
                    [--home=<dir> | --config=<dir>]
                    [--gui-user=<username>] [--gui-password=<password|->]
                    [--no-default-folder] [--skip-port-probing] [--no-console]
                    [--help]

          syncthing decrypt (--to=<dir> | --verify-only)
                    [--password=<pw>] [--folder-id=<id>] [--token-path=<file>]
                    [--continue] [--verbose] [--version] [--help]
                    <path>

          syncthing cli
                    [--home=<dir> | --config=<dir> --data=<dir>]
                    [--gui-address=<address>] [--gui-apikey=<key>]
                    [--help]
                    <command> [command options...] [arguments...]

DDEESSCCRRIIPPTTIIOONN
       Syncthing lets you synchronize your files bidirectionally across multi‐
       ple 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.

       The  ssyynncctthhiinngg core application is a command-line program which usually
       runs in the background and handles the synchronization. It  provides  a
       built-in,  HTML  and  JavaScript  based user interface to be controlled
       from a web browser. This frontend communicates with the  core  applica‐
       tion  through  some  HTTP  APIs, which other apps like graphical system
       integration helpers can use as well, for greatest flexibility.  A  link
       to reach the GUI and API is printed among the first few log messages.

OOPPTTIIOONNSS
       ----aallllooww--nneewweerr--ccoonnffiigg
              Try  loading  a  config file written by a newer program version,
              instead of failing immediately.

       ----aauuddiitt
              Write events to timestamped file aauuddiitt--YYYYYYYYMMMMDDDD--HHHHMMMMSSSS..lloogg.

       ----aauuddiittffiillee==<<ffiillee||--||---->>
              Use specified file or stream (""--"" for stdout, ""----""  for  stderr)
              for audit events, rather than the timestamped default file name.

       ----bbrroowwsseerr--oonnllyy
              Open  the  web  UI in a browser for an already running Syncthing
              instance.

       ----ddeevviiccee--iidd
              Print device ID to command line.

       ----ggeenneerraattee==<<ddiirr>>
              Generate key and config in specified dir, then exit.

       ----gguuii--aaddddrreessss==<<aaddddrreessss>>
              Override  GUI  listen  address.   Set   this   to   an   address
              (00..00..00..00::88338844)  or  file  path (//vvaarr//rruunn//sstt..ssoocckk, for UNIX sock‐
              ets).

       ----gguuii--aappiikkeeyy==<<ssttrriinngg>>
              Override the API key needed to access the GUI / REST API.

       ----gguuii--ppaasssswwoorrdd==<<ppaasssswwoorrdd||-->>
              Specify new GUI authentication password, to  update  the  config
              file.  Read from the standard input stream if only a single dash
              (--) is given.  The password is hashed before writing to the con‐
              fig  file.  As a special case, giving the existing password hash
              as password will leave it untouched.

       ----gguuii--uusseerr==<<uusseerrnnaammee>>
              Specify new GUI authentication user name, to update  the  config
              file.

       ----hheellpp,, --hh
              Show  help  text  about  command  line usage.  Context-sensitive
              depending on the given subcommand.

       ----hhoommee==<<ddiirr>>
              Set common configuration and data directory. The default config‐
              uration   directory   is   $$HHOOMMEE//..ccoonnffiigg//ssyynncctthhiinngg  (Unix-like),
              $$HHOOMMEE//LLiibbrraarryy//AApppplliiccaattiioonn SSuuppppoorrtt//SSyynncctthhiinngg (Mac) and %%LLOOCCAALLAAPPPP‐‐
              DDAATTAA%%\\SSyynncctthhiinngg (Windows).

       ----ccoonnffiigg==<<ddiirr>>
              Set  configuration  directory. Alternative to ----hhoommee and must be
              used together with ----ddaattaa.

       ----ddaattaa==<<ddiirr>>
              Set data (e.g. database) directory. Alternative  to  ----hhoommee  and
              must be used together with ----ccoonnffiigg.

       ----llooggffiillee==<<ffiilleennaammee>>
              Set  destination filename for logging (use ""--"" for stdout, which
              is the default option).

       ----llooggffllaaggss==<<ffllaaggss>>
              Select information in log line prefix. The ----llooggffllaaggss value is a
              sum of the following:

              · 1: Date

              · 2: Time

              · 4: Microsecond time

              · 8: Long filename

              · 16: Short filename

              To  prefix each log line with date and time, set ----llooggffllaaggss==33 (1
              + 2 from above). The value 0 is  used  to  disable  all  of  the
              above. The default is to show time only (2).

       ----lloogg--mmaaxx--oolldd--ffiilleess==<<nnuumm>>
              Number  of  old  files  to  keep  (zero  to  keep only current).
              Applies   only   when   log   rotation   is   enabled    through
              ----lloogg--mmaaxx--ssiizzee.

       ----lloogg--mmaaxx--ssiizzee==<<nnuumm>>
              Maximum size of any log file (zero to disable log rotation).

       ----nnoo--bbrroowwsseerr
              Do not start a browser.

       ----nnoo--ccoonnssoollee
              Hide the console window. (On Windows only)

       ----nnoo--ddeeffaauulltt--ffoollddeerr
              Donât create a default folder when generating an initial config‐
              uration / starting for the first time.

       ----nnoo--rreessttaarrtt
              Do not restart Syncthing when it exits. The monitor process will
              still  run to handle crashes and writing to logfiles (if config‐
              ured to).

       ----nnoo--uuppggrraaddee
              Disable automatic upgrades.  Equivalent to the SSTTNNOOUUPPGGRRAADDEE envi‐
              ronment variable, see below.

       ----ppaatthhss
              Print  the  paths  used  for  configuration, keys, database, GUI
              overrides, default sync folder and the log file.

       ----ppaauusseedd
              Start with all devices and folders paused.

       ----rreesseett--ddaattaabbaassee
              Reset the database, forcing a full  rescan  and  resync.  Create
              _._s_t_f_o_l_d_e_r  folders  in  each  sync folder if they do not already
              exist. CCaauuttiioonn: Ensure that all sync folders  which  are  mount‐
              points are already mounted.  Inconsistent versions may result if
              the mountpoint is later mounted and contains older versions.

       ----rreesseett--ddeellttaass
              Reset delta index IDs, forcing a full index exchange.

       ----sskkiipp--ppoorrtt--pprroobbiinngg
              Donât try to find unused random ports for  the  GUI  and  listen
              address  when generating an initial configuration / starting for
              the first time.

       ----uunnppaauusseedd
              Start with all devices and folders unpaused.

       ----uuppggrraaddee
              Perform upgrade.

       ----uuppggrraaddee--cchheecckk
              Check for available upgrade.

       ----uuppggrraaddee--ttoo==<<uurrll>>
              Force upgrade directly from specified URL.

       ----vveerrbboossee
              Print verbose log output.

       ----vveerrssiioonn
              Show version.

       ----ttoo==<<ddiirr>>
              Destination directory where files should be stored after decryp‐
              tion.

       ----vveerriiffyy--oonnllyy
              Donât  write  decrypted  files  to  disk  (but  verify plaintext
              hashes).

       ----ppaasssswwoorrdd==<<ppww>>
              Folder password for decryption / verification.   Can  be  passed
              through  the  FFOOLLDDEERR__PPAASSSSWWOORRDD  environment  variable  instead to
              avoid recording in a shellâs history buffer or sniffing from the
              running processes list.

       ----ffoollddeerr--iidd==<<iidd>>
              Folder  ID  of  the encrypted folder, if it cannot be determined
              automatically.

       ----ttookkeenn--ppaatthh==<<ffiillee>>
              Path to the token file within  the  folder  (used  to  determine
              folder ID).

       ----ccoonnttiinnuuee
              Continue  processing  next  file  in  case  of error, instead of
              aborting.

EEXXIITT CCOODDEESS
       00      Success / Shutdown

       11      Error

       22      Upgrade not available

       33      Restarting

       44      Upgrading

       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, 112288
       ++ 99 ((SSIIGGKKIILLLL)) == 113377.

SSUUBBCCOOMMMMAANNDDSS
       The  command line syntax actually supports different modes of operation
       through several subcommands, specified as the first argument.  If omit‐
       ted, the default sseerrvvee is assumed.

       The  initial  setup  of  a  device  ID and default configuration can be
       called explicitly with the ggeenneerraattee subcommand.  It can also update the
       configured  GUI  authentication  credentials, without going through the
       REST API.  An existing device certificate is left  untouched.   If  the
       configuration  file  already exists, it is validated and updated to the
       latest configuration schema, including adding default  values  for  any
       new options.

       The   ddeeccrryypptt   subcommand   is  used  in  conjunction  with  untrusted
       (encrypted)  devices,  see  the  relevant  section  on  decryption  for
       details.   It  does not depend on Syncthing to be running, but works on
       offline data.

       To work with the REST API for debugging or automating things  in  Sync‐
       thing,  the ccllii subcommand provides easy access to individual features.
       It basically saves the hassle of  handling  HTTP  connections  and  API
       authentication.

       The  available  subcommands are grouped into several nested hierarchies
       and  some  parts  dynamically  generated  from  the  running  Syncthing
       instance.   On every level, the ----hheellpp option lists the available prop‐
       erties, actions and commands for the user  to  discover  interactively.
       The top-level groups are:

       ccoonnffiigg Access  the  live  configuration  in a running instance over the
              REST  API  to  retrieve  (get)  or  update  (set)  values  in  a
              fine-grained  way.  The hierarchy is based on the same structure
              as used in the JSON / XML representations.

       sshhooww   Show system properties and status of a  running  instance.   The
              output  is  passed  on  directly  from the REST API response and
              therefore requires parsing JSON format.

       ooppeerraattiioonnss
              Control the overall program operation such as restarting or han‐
              dling  upgrades,  as  well  as  triggering  some  actions  on  a
              per-folder basis.

       eerrrroorrss Examine pending error conditions that need  attention  from  the
              user, or acknowledge (clear) them.

       ddeebbuugg  Various tools to aid in diagnosing problems or collection infor‐
              mation for bug reports.  Some of these commands access the data‐
              base  directly and can therefore only work when Syncthing is not
              running.

       -- ((aa ssiinnggllee ddaasshh))
              Reads subsequent commands from the standard input stream,  with‐
              out  needing  to  call  the ssyynncctthhiinngg ccllii command over and over.
              Exits on any  invalid  command  or  when  EOF  (end-of-file)  is
              received.

PPRROOXXIIEESS
       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 pos‐
       sible  to  accept  incoming connections through the proxy. The proxy is
       configured through the environment variable aallll__pprrooxxyy. Somewhat  unusu‐
       ally,  this  variable  must  be  named  in  lower  case  -  it  is  not
       âALL_PROXYâ. For example:

          $ export all_proxy=socks://192.0.2.42:8081

DDEEVVEELLOOPPMMEENNTT SSEETTTTIINNGGSS
       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.

       SSTTTTRRAACCEE
              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.
              ssyynncctthhiinngg  ----hheellpp  always  outputs an up-to-date list. The valid
              facility strings are:

              MMaaiinn aanndd ooppeerraattiioonnaall ffaacciilliittiieess::

                     ccoonnffiigg Configuration loading and saving.

                     ddbb     The database layer.

                     mmaaiinn   Main package.

                     mmooddeell  The root hub; the largest  chunk  of  the  system.
                            File  pulling, index transmission and requests for
                            chunks.

                     ssccaannnneerr
                            File change detection and hashing.

                     vveerrssiioonneerr
                            File versioning.

              NNeettwwoorrkkiinngg ffaacciilliittiieess::

                     bbeeaaccoonn Multicast and  broadcast  UDP  discovery  packets:
                            Selected interfaces and addresses.

                     ccoonnnneeccttiioonnss
                            Connection handling.

                     ddiiaalleerr Dialing connections.

                     ddiissccoovveerr
                            Remote device discovery requests, replies and reg‐
                            istration of devices.

                     nnaatt    NAT discovery and port mapping.

                     ppmmpp    NAT-PMP discovery and port mapping.

                     pprroottooccooll
                            The BEP protocol.

                     rreellaayy  Relay interaction (ssttrreellaayyssrrvv).

                     uuppnnpp   UPnP discovery and port mapping.

              OOtthheerr ffaacciilliittiieess::

                     ffss     Filesystem access.

                     eevveennttss Event generation and logging.

                     hhttttpp   REST API.

                     sshhaa225566 SHA256 hashing package  (this  facility  currently
                            unused).

                     ssttaattss  Persistent device and folder statistics.

                     ssyynncc   Mutexes.  Used  for  debugging race conditions and
                            deadlocks.

                     uuppggrraaddee
                            Binary upgrades.

                     wwaallkkffss Filesystem access while walking.

                     aallll    All of the above.

       SSTTBBLLOOCCKKPPRROOFFIILLEE
              Write block profiles  to  bblloocckk--$$ppiidd--$$ttiimmeessttaammpp..pppprrooff  every  20
              seconds.

       SSTTCCPPUUPPRROOFFIILLEE
              Write a CPU profile to ccppuu--$$ppiidd..pppprrooff on exit.

       SSTTDDEEAADDLLOOCCKKTTIIMMEEOOUUTT
              Used  for  debugging internal deadlocks; sets debug sensitivity.
              Use only under direction of a developer.

       SSTTLLOOCCKKTTHHRREESSHHOOLLDD
              Used for debugging internal deadlocks; sets  debug  sensitivity.
              Use only under direction of a developer.

       SSTTGGUUIIAADDDDRREESSSS
              Override    GUI   listen   address.    Equivalent   to   passing
              _-_-_g_u_i_-_a_d_d_r_e_s_s.

       SSTTGGUUIIAAPPIIKKEEYY
              Override the API key needed  to  access  the  GUI  /  REST  API.
              Equivalent to passing _-_-_g_u_i_-_a_p_i_k_e_y.

       SSTTGGUUIIAASSSSEETTSS
              Directory to load GUI assets from. Overrides compiled in assets.
              Useful  for  developing  webgui,  commonly  use  SSTTGGUUIIAASSSSEETTSS==gguuii
              bbiinn//ssyynncctthhiinngg.

       SSTTHHAASSHHIINNGG
              Specify  which  hashing  package  to  use. Defaults to automatic
              based on performance. Specify âminioâ (compatibility) or  âstan‐
              dardâ for the default Go implementation.

       SSTTHHEEAAPPPPRROOFFIILLEE
              Write heap profiles to hheeaapp--$$ppiidd--$$ttiimmeessttaammpp..pppprrooff each time heap
              usage increases.

       SSTTNNOODDEEFFAAUULLTTFFOOLLDDEERR
              Donât create a default folder when starting for the first  time.
              This  variable  will  be  ignored  anytime  after the first run.
              Equivalent to the _-_-_n_o_-_d_e_f_a_u_l_t_-_f_o_l_d_e_r flag.

       SSTTNNOORREESSTTAARRTT
              Equivalent to the _-_-_n_o_-_r_e_s_t_a_r_t flag.

       SSTTNNOOUUPPGGRRAADDEE
              Disable automatic  upgrades.   Equivalent  to  the  _-_-_n_o_-_u_p_g_r_a_d_e
              flag.

       SSTTPPRROOFFIILLEERR
              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
              _h_t_t_p_:_/_/_l_o_c_a_l_h_o_s_t_:_9_0_9_0_/_d_e_b_u_g_/_p_p_r_o_f.  See  ggoo  ttooooll pppprrooff for more
              information.

       SSTTPPEERRFFSSTTAATTSS
              Write running performance statistics to ppeerrff--$$ppiidd..ccssvv. Not  sup‐
              ported on Windows.

       SSTTRREECCHHEECCKKDDBBEEVVEERRYY
              Time  before folder statistics (file, dir, â¦ counts) are recal‐
              culated from scratch. The given duration must  be  parseable  by
              Goâs  ttiimmee..PPaarrsseeDDuurraattiioonn.  If  missing  or  not  parseable,  the
              default value of 1 month is  used.  To  force  recalculation  on
              every startup, set it to 11ss.

       SSTTGGCCIINNDDIIRREECCTTEEVVEERRYY
              Sets  the  time  interval in between database garbage collection
              runs.  The given duration must be parseable by Goâs  ttiimmee..PPaarrssee‐‐
              DDuurraattiioonn.

       GGOOMMAAXXPPRROOCCSS
              Set  the  maximum  number  of  CPU cores to use. Defaults to all
              available CPU cores.

       GGOOGGCC   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 (i.e. performance).

       LLOOGGGGEERR__DDIISSCCAARRDD
              Hack to completely disable logging,  for  example  when  running
              benchmarks.  Set to any nonempty value to use it.

SSEEEE AALLSSOO
       ssyynncctthhiinngg--ccoonnffiigg((55)),   ssyynncctthhiinngg--ssttiiggnnoorree((55)),  ssyynncctthhiinngg--ddeevviiccee--iiddss((77)),
       ssyynncctthhiinngg--sseeccuurriittyy((77)),   ssyynncctthhiinngg--nneettwwoorrkkiinngg((77)),    ssyynncctthhiinngg--vveerrssiioonn‐‐
       iinngg((77)), ssyynncctthhiinngg--ffaaqq((77))

AAUUTTHHOORR
       The Syncthing Authors

CCOOPPYYRRIIGGHHTT
       2014-2019, The Syncthing Authors



v1.19.2                          Apr 05, 2022                     SYNCTHING(1)
