SYNCTHING(1)                       Syncthing                      SYNCTHING(1)



NNAAMMEE
       syncthing - Syncthing

SSYYNNOOPPSSIISS
          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...]

DDEESSCCRRIIPPTTIIOONN
       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  ssyynncctthhiinngg 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.

OOPPTTIIOONNSS
       ----aallllooww--nneewweerr--ccoonnffiigg
              Try  loading  a  config file written by a newer program version,
              instead of failing immediately.

       ----aauuddiitt
              Write events to timestamped file aauuddiitt--YYYYYYYYMMMMDDDD--HHHHMMMMSSSS..lloogg.

       ----aauuddiittffiillee==<<ffiillee||--||---->>
              Use specified file or stream (""--"" for stdout, ""----""  for  stderr)
              for audit events, rather than the timestamped default file name.

       ----bbrroowwsseerr--oonnllyy
              Open  the  web  UI in a browser for an already running Syncthing
              instance.

       ----ddeevviiccee--iidd
              Print device ID to command line.

       ----ggeenneerraattee==<<ddiirr>>
              Generate key and config in specified dir, then exit.

       ----gguuii--aaddddrreessss==<<aaddddrreessss>>
              Override  GUI  listen  address.   Set   this   to   an   address
              (00..00..00..00::88338844)  or  file  path (//vvaarr//rruunn//sstt..ssoocckk, for UNIX sock‐
              ets).

       ----gguuii--aappiikkeeyy==<<ssttrriinngg>>
              Override the API key needed to access the GUI / REST API.

       ----gguuii--ppaasssswwoorrdd==<<ppaasssswwoorrdd||-->>
              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.

       ----gguuii--uusseerr==<<uusseerrnnaammee>>
              Specify new GUI authentication user name, to update  the  config
              file.

       ----hheellpp,, --hh
              Show  help  text  about  command  line usage.  Context-sensitive
              depending on the given subcommand.

       ----hhoommee==<<ddiirr>>
              Set common configuration and data directory. The default config‐
              uration   directory   is   $$HHOOMMEE//..ccoonnffiigg//ssyynncctthhiinngg  (Unix-like),
              $$HHOOMMEE//LLiibbrraarryy//AApppplliiccaattiioonn SSuuppppoorrtt//SSyynncctthhiinngg (Mac) and %%LLOOCCAALLAAPPPP‐‐
              DDAATTAA%%\\SSyynncctthhiinngg (Windows).

       ----ccoonnffiigg==<<ddiirr>>
              Set  configuration  directory. Alternative to ----hhoommee and must be
              used together with ----ddaattaa.

       ----ddaattaa==<<ddiirr>>
              Set data (e.g. database) directory. Alternative  to  ----hhoommee  and
              must be used together with ----ccoonnffiigg.

       ----llooggffiillee==<<ffiilleennaammee>>
              Set  destination filename for logging (use ""--"" for stdout, which
              is the default option).

       ----llooggffllaaggss==<<ffllaaggss>>
              Select information in log line prefix. The ----llooggffllaaggss 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 ----llooggffllaaggss==33 (1
              + 2 from above). The value 0 is  used  to  disable  all  of  the
              above. The default is to show time only (2).

       ----lloogg--mmaaxx--oolldd--ffiilleess==<<nnuumm>>
              Number  of  old  files  to  keep  (zero  to  keep only current).
              Applies   only   when   log   rotation   is   enabled    through
              ----lloogg--mmaaxx--ssiizzee.

       ----lloogg--mmaaxx--ssiizzee==<<nnuumm>>
              Maximum size of any log file (zero to disable log rotation).

       ----nnoo--bbrroowwsseerr
              Do not start a browser.

       ----nnoo--ccoonnssoollee
              Hide the console window. (On Windows only)

       ----nnoo--ddeeffaauulltt--ffoollddeerr
              Donât create a default folder when generating an initial config‐
              uration / starting for the first time.

       ----nnoo--rreessttaarrtt
              Do not restart Syncthing when it exits. The monitor process will
              still  run to handle crashes and writing to logfiles (if config‐
              ured to).

       ----nnoo--uuppggrraaddee
              Disable automatic upgrades.  Equivalent to the SSTTNNOOUUPPGGRRAADDEE envi‐
              ronment variable, see below.

       ----ppaatthhss
              Print  the  paths  used  for  configuration, keys, database, GUI
              overrides, default sync folder and the log file.

       ----ppaauusseedd
              Start with all devices and folders paused.

       ----rreesseett--ddaattaabbaassee
              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. CCaauuttiioonn: 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.

       ----rreesseett--ddeellttaass
              Reset delta index IDs, forcing a full index exchange.

       ----sskkiipp--ppoorrtt--pprroobbiinngg
              Donât try to find unused random ports for  the  GUI  and  listen
              address  when generating an initial configuration / starting for
              the first time.

       ----uunnppaauusseedd
              Start with all devices and folders unpaused.

       ----uuppggrraaddee
              Perform upgrade.

       ----uuppggrraaddee--cchheecckk
              Check for available upgrade.

       ----uuppggrraaddee--ttoo==<<uurrll>>
              Force upgrade directly from specified URL.

       ----vveerrbboossee
              Print verbose log output.

       ----vveerrssiioonn
              Show version.

       ----ttoo==<<ddiirr>>
              Destination directory where files should be stored after decryp‐
              tion.

       ----vveerriiffyy--oonnllyy
              Donât  write  decrypted  files  to  disk  (but  verify plaintext
              hashes).

       ----ppaasssswwoorrdd==<<ppww>>
              Folder password for decryption / verification.   Can  be  passed
              through  the  FFOOLLDDEERR__PPAASSSSWWOORRDD  environment  variable  instead to
              avoid recording in a shellâs history buffer or sniffing from the
              running processes list.

       ----ffoollddeerr--iidd==<<iidd>>
              Folder  ID  of  the encrypted folder, if it cannot be determined
              automatically.

       ----ttookkeenn--ppaatthh==<<ffiillee>>
              Path to the token file within  the  folder  (used  to  determine
              folder ID).

       ----ccoonnttiinnuuee
              Continue  processing  next  file  in  case  of error, instead of
              aborting.

EEXXIITT CCOODDEESS
       00      Success / Shutdown

       11      Error

       22      Upgrade not available

       33      Restarting

       44      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, 112288
       ++ 99 ((SSIIGGKKIILLLL)) == 113377.

SSUUBBCCOOMMMMAANNDDSS
       The  command line syntax actually supports different modes of operation
       through several subcommands, specified as the first argument.  If omit‐
       ted, the default sseerrvvee is assumed.

       The  initial  setup  of  a  device  ID and default configuration can be
       called explicitly with the ggeenneerraattee 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   ddeeccrryypptt   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 ccllii 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 ----hheellpp option lists the available prop‐
       erties, actions and commands for the user  to  discover  interactively.
       The top-level groups are:

       ccoonnffiigg 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.

       sshhooww   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.

       ooppeerraattiioonnss
              Control the overall program operation such as restarting or han‐
              dling  upgrades,  as  well  as  triggering  some  actions  on  a
              per-folder basis.

       eerrrroorrss Examine pending error conditions that need  attention  from  the
              user, or acknowledge (clear) them.

       ddeebbuugg  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.

       -- ((aa ssiinnggllee ddaasshh))
              Reads subsequent commands from the standard input stream,  with‐
              out  needing  to  call  the ssyynncctthhiinngg ccllii command over and over.
              Exits on any  invalid  command  or  when  EOF  (end-of-file)  is
              received.

PPRROOXXIIEESS
       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 aallll__pprrooxxyy. 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

DDEEVVEELLOOPPMMEENNTT SSEETTTTIINNGGSS
       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.

       SSTTTTRRAACCEE
              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.
              ssyynncctthhiinngg  ----hheellpp  always  outputs an up-to-date list. The valid
              facility strings are:

              MMaaiinn aanndd ooppeerraattiioonnaall ffaacciilliittiieess::

                     ccoonnffiigg Configuration loading and saving.

                     ddbb     The database layer.

                     mmaaiinn   Main package.

                     mmooddeell  The root hub; the largest  chunk  of  the  system.
                            File  pulling, index transmission and requests for
                            chunks.

                     ssccaannnneerr
                            File change detection and hashing.

                     vveerrssiioonneerr
                            File versioning.

              NNeettwwoorrkkiinngg ffaacciilliittiieess::

                     bbeeaaccoonn Multicast and  broadcast  UDP  discovery  packets:
                            Selected interfaces and addresses.

                     ccoonnnneeccttiioonnss
                            Connection handling.

                     ddiiaalleerr Dialing connections.

                     ddiissccoovveerr
                            Remote device discovery requests, replies and reg‐
                            istration of devices.

                     nnaatt    NAT discovery and port mapping.

                     ppmmpp    NAT-PMP discovery and port mapping.

                     pprroottooccooll
                            The BEP protocol.

                     rreellaayy  Relay interaction (ssttrreellaayyssrrvv).

                     uuppnnpp   UPnP discovery and port mapping.

              OOtthheerr ffaacciilliittiieess::

                     ffss     Filesystem access.

                     eevveennttss Event generation and logging.

                     hhttttpp   REST API.

                     sshhaa225566 SHA256 hashing package  (this  facility  currently
                            unused).

                     ssttaattss  Persistent device and folder statistics.

                     ssyynncc   Mutexes.  Used  for  debugging race conditions and
                            deadlocks.

                     uuppggrraaddee
                            Binary upgrades.

                     wwaallkkffss Filesystem access while walking.

                     aallll    All of the above.

       SSTTBBLLOOCCKKPPRROOFFIILLEE
              Write block profiles  to  bblloocckk--$$ppiidd--$$ttiimmeessttaammpp..pppprrooff  every  20
              seconds.

       SSTTCCPPUUPPRROOFFIILLEE
              Write a CPU profile to ccppuu--$$ppiidd..pppprrooff on exit.

       SSTTDDEEAADDLLOOCCKKTTIIMMEEOOUUTT
              Used  for  debugging internal deadlocks; sets debug sensitivity.
              Use only under direction of a developer.

       SSTTLLOOCCKKTTHHRREESSHHOOLLDD
              Used for debugging internal deadlocks; sets  debug  sensitivity.
              Use only under direction of a developer.

       SSTTGGUUIIAADDDDRREESSSS
              Override    GUI   listen   address.    Equivalent   to   passing
              _-_-_g_u_i_-_a_d_d_r_e_s_s.

       SSTTGGUUIIAAPPIIKKEEYY
              Override the API key needed  to  access  the  GUI  /  REST  API.
              Equivalent to passing _-_-_g_u_i_-_a_p_i_k_e_y.

       SSTTGGUUIIAASSSSEETTSS
              Directory to load GUI assets from. Overrides compiled in assets.
              Useful  for  developing  webgui,  commonly  use  SSTTGGUUIIAASSSSEETTSS==gguuii
              bbiinn//ssyynncctthhiinngg.

       SSTTHHAASSHHIINNGG
              Specify  which  hashing  package  to  use. Defaults to automatic
              based on performance. Specify âminioâ (compatibility) or  âstan‐
              dardâ for the default Go implementation.

       SSTTHHEEAAPPPPRROOFFIILLEE
              Write heap profiles to hheeaapp--$$ppiidd--$$ttiimmeessttaammpp..pppprrooff each time heap
              usage increases.

       SSTTNNOODDEEFFAAUULLTTFFOOLLDDEERR
              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.

       SSTTNNOORREESSTTAARRTT
              Equivalent to the _-_-_n_o_-_r_e_s_t_a_r_t flag.

       SSTTNNOOUUPPGGRRAADDEE
              Disable automatic  upgrades.   Equivalent  to  the  _-_-_n_o_-_u_p_g_r_a_d_e
              flag.

       SSTTPPRROOFFIILLEERR
              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  ggoo  ttooooll pppprrooff for more
              information.

       SSTTPPEERRFFSSTTAATTSS
              Write running performance statistics to ppeerrff--$$ppiidd..ccssvv. Not  sup‐
              ported on Windows.

       SSTTRREECCHHEECCKKDDBBEEVVEERRYY
              Time  before folder statistics (file, dir, â¦ counts) are recal‐
              culated from scratch. The given duration must  be  parseable  by
              Goâs  ttiimmee..PPaarrsseeDDuurraattiioonn.  If  missing  or  not  parseable,  the
              default value of 1 month is  used.  To  force  recalculation  on
              every startup, set it to 11ss.

       SSTTGGCCIINNDDIIRREECCTTEEVVEERRYY
              Sets  the  time  interval in between database garbage collection
              runs.  The given duration must be parseable by Goâs  ttiimmee..PPaarrssee‐‐
              DDuurraattiioonn.

       GGOOMMAAXXPPRROOCCSS
              Set  the  maximum  number  of  CPU cores to use. Defaults to all
              available CPU cores.

       GGOOGGCC   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).

       LLOOGGGGEERR__DDIISSCCAARRDD
              Hack to completely disable logging,  for  example  when  running
              benchmarks.  Set to any nonempty value to use it.

SSEEEE AALLSSOO
       ssyynncctthhiinngg--ccoonnffiigg((55)),   ssyynncctthhiinngg--ssttiiggnnoorree((55)),  ssyynncctthhiinngg--ddeevviiccee--iiddss((77)),
       ssyynncctthhiinngg--sseeccuurriittyy((77)),   ssyynncctthhiinngg--nneettwwoorrkkiinngg((77)),    ssyynncctthhiinngg--vveerrssiioonn‐‐
       iinngg((77)), ssyynncctthhiinngg--ffaaqq((77))

AAUUTTHHOORR
       The Syncthing Authors

CCOOPPYYRRIIGGHHTT
       2014-2019, The Syncthing Authors



v1.19.2                          Apr 05, 2022                     SYNCTHING(1)
