Sync files between devices with Syncthing

Slashdot it! Delicious Share on Facebook Tweet! Digg!

Versioning

The file versioning menu entry (Figure 7) offers various modes for keeping version backups of changed data. The most basic case is one in which you switch off the function or use a simple versioning for keeping a predetermined number of copies of deleted or modified files in a hidden directory .stversions/ . By comparison, the step-by-step versioning is oriented toward the expiration date of the copy. In external versioning, an external command is used to start the process.

Figure 7: The integrated versioning routine makes it possible to determine precisely how often and how long file modifications should be kept.

The ignore permissions option is only needed when the directory that has been added is sitting in a FAT partition. Via share with these devices you can select the devices which are to be synchronized with this directory. Via Ignore pattern , you can exclude entire subdirectories from the synchronization process.

Integrating the System

You will need to arrange for Syncthing to automatically load when a device starts. This is true for all of the distributions that use systemd and therefore also for Ubuntu and openSUSE. To do this, create a service file with the content from Listing 2 and name it syncthing.service . Next, create the directory ~/.config/systemd/user and move the file into the directory.

Listing 2

syncthing.service

[Unit]
Description=Syncthing - Open Source Continuous File Synchronization
Documentation=http://docs.syncthing.net/
After=network.target
[Service]
Environment=STNORESTART=yes
ExecStart=/usr/bin/syncthing -no-browser -logflags=0
Restart=on-failure
SuccessExitStatus=2 3 4
RestartForceExitStatus=3 4
[Install]
WantedBy=default.target

After this step, you should enter the first two lines from Listing 3 as a normal user. Once the computer is restarted, Syncthing should automatically start. If this does not work, then the command from line 3 in Listing 3 should help locate the error.

Listing 3

Checking Status

$ systemctl --user enable syncthing.service
$ systemctl --user start syncthing.service
$ systemctl -l status syncthing.service

Buy this article as PDF

Express-Checkout as PDF

Pages: 6

Price $0.99
(incl. VAT)

Buy Ubuntu User

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content