Rescanning

Although syncthing has a rescan button, sometimes it is necessary to trigger a full rescan. A most common error message is the following:

[GRXBW] 17:53:20 INFO: Puller (folder "nibs", file "Images/Open/wall.png"): dst stat dir: stat /Users/nibs/Images/Open/: no such file or directory

In order to do this, the index directory must be deleted:

Operating System Folder Location
Windows %AppData%/Syncthing/index
Unix ~/.config/syncthing/index
OS X ~/Library/Application Support/Syncthing/index

After the removal of the file, restart syncthing and it will perform a full rescan of the folders.

Synchronising Home Folder

The following sync patterns will prevent synchronising items that have a local state and they are best used for synchronising user home folders.

OSX

// ignore dot files
.**
// ignore folders
Library/**
Desktop/**
Public/**
Downloads/**
Applications/**
Music/iTunes/**
AppData/**

Windows

// include folders
!AppData
!Contacts
!Documents
!Favorites
!Music
!Pictures
!Videos

// ignore all the rest
*

Files that Should Not Be Synchronised

The following files are junk, temporary, trash or state files that should generally not be synchronised:

// Firefox Downloads
*.part
// Chrome Downloads
*.crdownload
// Safari Downloads
*.download

// Temporary / Backup
*~
.*.swp
*.pst
~*
*.tmp
*.bak

// OSX
.DSSTORE?
.DS_Store
.Spotlight-V100
.Trashes
.Trash
Icon?
._*
.TemporaryItems

// Linux
.directory
.Trash-*.

// Windows
desktop.ini
ehthumbs.db
Thumbs.db
$RECYCLE.BIN

// BTSync
.sync
*.bts
*.!Sync
.SyncID
.SyncIgnore
.SyncArchive
*.SyncPart
*.SyncTemp
*.SyncOld

// Synology
@eaDir

Setting a Different Listen Address and Port

A different listening address and port can be set for syncthing by editing the config.xml file (usually to be found under the user's home directory at ~/.config/syncthing/).

The relevant part of code that refers to the web-interface is the following:

    <gui enabled="true" tls="false">
        <address>127.0.0.1:8384</address>
        <apikey>pBiQ3691PGcxqeOSLz101qML0188H1P5</apikey>
    </gui>

where 127.0.0.1 is the listening address and 8384 is the port that syncthing listens on.

Limiting CPU and RAM Usage

Unfortunately, syncthing is unbelievably inefficient on most platforms such that is consumes a very large amount of CPU and RAM. Since RAM can be considered in most personal circumstances relatively cheap, the CPU consumption is relatively prohibitive, especially if you are running syncthing on highly optimised and minimal systems. For example, running syncthing (at version v0.11.25, at the time of writing) on an Macbook Air will keep your CPU constantly at about 20-30%. Since this is rather much, one can use cpulimit to forcibly allow syncthing to only use up an agreeable amount of CPU.

To use cpulimit, first install it via homebrew as you are used to:

brew install cpulimit

Assuming that syncthing is already installed, you will find the launcher in ~/Library/LaunchAgents/homebrew.mxcl.syncthing.plist.

First, change directory to the launch file:

cd ~/Library/LaunchAgents/

and stop syncthing by typing:

launchctl unload homebrew.mxcl.syncthing.plist

Next, edit homebrew.mxcl.syncthing.plist with your favourite editor to change some things. Find the subsection ProgramArguments:

    <key>ProgramArguments</key>
    <array>
      <string>/usr/local/opt/syncthing/bin/syncthing</string>
      <string>-no-browser</string>
      <string>-no-restart</string>
    </array>

and change it to this:

    <key>ProgramArguments</key>
    <array>
      <string>/usr/local/bin/cpulimit</string>
      <string>--limit=5</string>
      <string>/usr/local/opt/syncthing/bin/syncthing</string>
      <string>-no-browser</string>
      <string>-no-restart</string>
    </array>

where:

  • /usr/local/bin/cpulimit is the path to the cpulimit binary installed by homebrew.
  • –limit=5 means that only $5%$ CPU consumption is allowed at any time for syncthing and all child processes.

and the rest are default launch parameters for syncthing.


fuss/syncthing.txt · Last modified: 2022/04/19 08:28 by 127.0.0.1

Access website using Tor Access website using i2p Wizardry and Steamworks PGP Key


For the contact, copyright, license, warranty and privacy terms for the usage of this website please see the contact, license, privacy, copyright.