I’ve been trying to be less dependent on Google, Amazon etc. — pretty futile but at least an opportunity to get better at UNIX administration and learn stuff like Ansible1 and Borg.

Here are my requirements:

  1. Automatically sync photos from my phone to my NAS
  2. Sync mp3s and random files between my phone, laptop, and NAS
  3. Delete old photos from my phone, only keep them on the NAS to save space
  4. Encrypted, automated off-site backup of photos
  5. Capture most of the above in an Ansible config

To accomplish file syncing between my phone, laptop and NAS, I use Syncthing. If you haven’t used it, Syncthing is fantastic. It does peer-to-peer syncing of files between computers, typically but not necessarily on a LAN. The only thing that took me a while to figure out is that you have to be patient — sometimes it will take a few minutes of unresponsiveness before it implements changes.

Deleting old photos is done with a simple Python script, which just checks the timestamps and deletes photos older than a certain age from my phone.

I view photos from the NAS with Shotwell, which rules: Screenshot of Shotwell For encrypted off-site backup I use Borg. I seriously tried to use Restic but never got there. Borg works very well and ticks the boxes — backups are de-duplicated and encrypted, the CLI is nice to use, and Borg is directly supported by who actually keep the data.

graph LR; laptop(Laptop) phone(Phone) nas(NAS) rsync( nas-- Borg ---rsync laptop-- Syncthing ---nas phone-- Syncthing ---nas phone-- Syncthing ---laptop

  1. I love the generic picture they have on the Ansible homepage. Ah yes, a gray desk with a computer on it. That’s the good stuff ↩︎