I’m sometimes terrible at not practicing what I preach – case in point: file backup. I have a great file backup strategy and have invested into the necessary physical and remote (cloud) services to store all my backups, but I still haven’t quite gotten a solid automation schedule in place and have to remember to manually kick off backups of my important devices on regular intervals to ensure files and/or local backups are pushed to a secondary location. That’s where I sometimes procrastinate.
A recent mobile phone switch left me in a panic when a MicroSD card got corrupted, and about a months worth of pictures were potentially lost (including a recent business trip!). Luckily, after a painstaking evening of hard work, some file recovery software was able to give me a 100% backup of the card and no data was actually lost – only my pride.
Sometimes it takes a scare like that to force me to get my shit in gear. I needed a better mobile backup strategy because remembering to go through our phones and tablets, connect them to a PC, and make regular backups of everything to the home server was just too time consuming and would get put off more often than not. Syncthing seemed like just what I needed.
What’s Syncthing?
Think of it like Dropbox, except you run the server and aren’t bound to either small storage on a free plan, or paying through the nose for lots of storage on a paid plan. My home server has plenty of free storage and can be expanded at anytime. I want to push all my devices to backups on the home server for that reason. Secondly, my server itself is backed up in full to a second set of physical external drives, so in essence my mobile phone data ends up double backed up (which is largely unnecessary for this type of data, but nice to have!).
With Syncthing you can setup shared folders, and control exactly what gets replicated where, and whether it’s a single direction or bi-directional sync. This is the perfect solution not just for my mobile phone, but something I can also wrap my laptops into for easy backup to the server as well!
Let’s get it running!
I run Docker on my home server, so installing the Syncthing server was completed in about 3 minutes. I setup my necessary directories; one for the configuration file location, and another for my backup destination, and installed from the LinuxServer.io Docker image.
On my mobile phone, the native Android Syncthing app was a quick install from the Play Store. Next, I simply had to add my devices to each other at each location, and then select and setup my share folders. This was easy enough to do that I didn’t need to reference any online guides, though I did find myself Google searching what some of the more advanced settings I saw on the page would do. I didn’t need to use any of those though.
Syncthing in the context of mobile backups
Let’s talk about a few things specific to backing up mobile devices for a moment.
First, you don’t need to bother with complex port forwards to get Syncthing working outside of your LAN. As long as either the mobile or the server can reach the other device, then it’ll establish a connection no matter where you are. This was a bonus, I didn’t realize this going into it and figured I’d have to port forward or just run backups from my home LAN. When I travel this will be nice to backup the days photos back to home overnight in case my phone gets damaged, lost or stolen on the go. This alone is huge for me as I’m always paranoid about what would happen on an exciting trip if my mobile phone, and all the pictures I’ve taken for the trip duration, would become missing or inoperable before getting home.
Second, in a mobile scenario you may want to do what I’ve done to tweak connection and power settings required for backups. I’ve set the app to only backup if connected to AC, and if connected to WiFi. I don’t need it running 24/7 and chewing up battery and/or data caps. This is all independently configured in the app settings.
To Conclude
Syncthing was absolutely effortless to setup. They have native apps for just about every common desktop and mobile platform on the market, so there’s no need to worry about having to hack together a solution or use third party apps – it’s all right there, available, and regularly maintained and updated by the team.
You could run a Syncthing server on something as cheap and simple as a Raspberry Pi with a USB hard drive attached to it for well under $150 in setup costs – saving you what could amount to hundreds annually if you paid for a cloud backup service with a similar capacity to that big USB hard drive!
I originally setup Syncthing as an effortless and hands off mobile backup solution, but it’s already on every device we own ensuring our mobiles, laptops, tablets and desktops are all backing up critical data to the home server in a “hands off” manner that I can’t procrastinate on!
For phase 2 in this project, I’m thinking of setting up Syncthing on some remote VPS servers as well so their scripted local backup files can be copied back home without needing to login to each server periodically and pull down the latest backups. Phase 3 may see me building an “all in one” enclosure to hold a Raspberry Pi + USB Hard Drive so I can plant a remote Syncthing client at my parents house for off-site backups of mission critical data that I schedule to run during the overnight hours so it isn’t tying up anyone’s internet connection during waking hours.