There is a point to this story, but it has temporarily escaped my mind...
Contact Me MyFaceBook MyLinkedIn MyGitHub MyTwitter

Install Syncthing

Syncthing replaces proprietary sync and cloud services with something open, trustworthy and decentralized. It is an alternative to BitTorrent Sync and doesn't have the “stigma” associated with the “BitTorrent” phrase. I use this program to keep files synchronized between systems. Like my BitTorrent Sync installs, I have one server sitting in the “cloud” that is always on so that my various systems can always have the latest copies of the files and I don't have to deal with port-forwarding on firewalls. This “cloud” server typically is a Linux VPS system…

wget -nv -O - https://syncthing.net/release-key.txt | sudo apt-key add
 
sudo add-apt-repository "deb https://apt.syncthing.net/ syncthing release" 
 
sudo apt update
sudo apt install -y syncthing
 
syncthing --version
 
sudo mkdir -p /opt/syncthing
 
sudo syncthing -home="/opt/syncthing" -generate="/opt/syncthing"
 
sudo sed -i 's/<upnpEnabled>true<\/upnpEnabled>/<upnpEnabled>false<\/upnpEnabled>/g' /opt/syncthing/config.xml
 
sudo useradd -M syncthing
 
sudo chown -R syncthing:syncthing /opt/syncthing

Configure a startup script

cat > /tmp/syncthing.service << EOF
[Unit]
Description=Syncthing Server
Documentation=

Wants=network.target
After=network.target

[Service]
User=syncthing
Group=syncthing
KillMode=process
SuccessExitStatus=3 4
RestartForceExitStatus=3 4

WorkingDirectory=/opt/syncthing
ExecStart=/usr/bin/syncthing -home="/opt/syncthing" -logfile="/var/log/syncthing.log"

[Install]
WantedBy=multi-user.target
EOF

sudo mv /tmp/syncthing.service /etc/systemd/system/
sudo chown root:root /etc/systemd/system/syncthing.service

sudo systemctl enable syncthing.service

sudo touch /var/log/syncthing.log
sudo chown syncthing /var/log/syncthing.log

cat > /tmp/syncthing << EOF
/var/log/syncthing
{
        rotate 4
        weekly
        missingok
        notifempty
        compress
        delaycompress
 }
EOF
sudo mv /tmp/syncthing /etc/logrotate.d/
sudo chown root:root /etc/logrotate.d/syncthing

Start Syncthing Service

sudo service syncthing start
Copyright © 2022 by Julian Easterling. SOME RIGHTS RESERVED.
Privacy Policy              Terms of Use             


Creative Commons License
Except where otherwise noted, content on this site is
licensed under a Creative Common Attribution-Share Alike 4.0 International License.


All of the opinions expressed on this website are those of Julian Easterling and
do not represent the views of any of my current and previous clients or employers in any way.

If you notice an error on the site or content that has not been properly attributed, bring
it to my attention using the contact page and I will endeavor to fix it as soon as I can.

I accept no responsibility or liability for any damages incurred by following any of
my advice or by using any of the information on my site or of those sites that I link to.