Syncthing as Backup

I’m on a quest to figure out the best way to automatically backup just the recent photos (not the entire library) on my SO’s Android mobile phone.

Currently, for myself, my recent photos are automatically uploaded to Dropbox and when I access my computer, I manually move the photos in Dropbox to a a separate photos folder. Then, whenever I have the time or when I remember to do so, I will borg all my files to my external SSD.

As an aside, while my files are not mission critical, they are important enough to me that I should definitely implement the 3-2-1 backup rule. There are a number of options and I’m still evaluating which will be the efficient and cost-effective solution for us.

This flow does not work for my SO:

Enter Syncthing, which I Installed on a VPS:

sudo apt-get install apt-transport-https ca-certificates gnupg
curl -s https://syncthing.net/release-key.txt | sudo apt-key add -
echo "deb https://apt.syncthing.net/ syncthing stable" | sudo tee /etc/apt/sources.list.d/syncthing.list
sudo apt-get update && sudo apt-get install syncthing

Start Syncthing:

syncthing

Edit ~/.config/syncthing/config.xml:

<address>0.0.0.0:8384</address>

Reboot the system:

sudo reboot

Download missing systemd service files:

git clone https://github.com/syncthing/syncthing
cd syncthing/etc/linux-systemd/system
sudo mv [email protected] /etc/systemd/system/[email protected]

Enable and start service (replace lzy with your actual username):

sudo systemctl enable [email protected]
sudo systemctl start [email protected]

If ufw is enabled, make sure to allow the Syncthing ports:

sudo ufw allow 22000/tcp
sudo ufw allow 21027/udp
sudo ufw allow 8384/tcp

Access the Syncthing UI via the IP address with port 8384. Set the GUI Authentication. However, since this is primarily a sync solution and not intended for backups, I’ve set the Folder Type to “Receive Only”, File Versioning to “Trash Can File Versioning” and to keep files in the trash can forever.

The ignoreDelete function should also be enabled on the client side to be safe, so when any of the files are deleted on the server side, the “deletion” will not be synced.

2020-09-25

index