HOM 26: Syncthing

Beep boop - this is a robot. A new show has been posted to TWiT…

What are your thoughts about today’s show? We’d love to hear from you!

1 Like

Syncthing is a great tool, it’s even better paired with an always on computer like a Raspberry Pi (best use for my Pi beside a Pi Hole).

1 Like

Love it, Leo. Thanks for showing Syncthing!

I’ve now got it setup with 2 local Macs, and will be extending it to virtual machines running Win10 and Ubuntu 20.04.

One of my Macs is an old 2008 Mac Pro that’s still my workhorse running El Capitan (10.11), so AirDrop doesn’t work with my new MacBook Pro 16", but Syncthing does.

Another thing to point out is that it’s much easier to just use the pre-built .dmg on the Syncthing project site. At first I went the “Base Syncthing” from https://syncthing.net/downloads/ but reverted and used the pre-built syncthing-macos.dmg image. Much easier and worked perfectly without the find & replace username hassles.

Syncthing is a very nice solution for folder sync, for use alongside the cloud solutions like iCloud, Dropbox, OneDrive, etc. It’ll greatly help sharing and syncing files locally in my landscape!

My initial purpose was for syncing my shell dot files (e.g. .zshrc, .bash_profile). I’m not sure if there’s a better way, but for now I’m basically just managing them with a gist on GitHub that I’ve forked and maintain with my preferences. See here: https://gist.github.com/douglasmaltby/103c4463c76b5ebf1412b97b94ba3fce

I’ll be interested to see if lra/mackup does this kind of sync in a better, more direct file-based way.

Thanks for sharing all your Mac “black diamond” knowledge Leo. The geekier, the better in my book!
Doug

I was also thinking about the potential use of Synching with an Automator file action shell script to watch the sync folder and copy the dotfile when a new change arrives, but that wouldn’t work cross-platform with linux and Win10, so…

I keep my dotfiles in the default Syncthing (~/Sync) folder then softlink them to their proper places. Works like a charm.

#!/bin/bash

### Symlink master dotfiles into my home directory

dir=~/Sync/dotfiles               # synced master dotfiles directory
olddir=~/dotfiles_old             # backup for original dotfiles, just in case

# list of files/folders to symlink in homedir, amend as needed
files="claws-mail emacs.d config/fish ssh gnupg kitty"  

# create backup in home directory
echo "Creating $olddir for backup of any existing dotfiles in ~"
mkdir -p $olddi

# move any existing dotfiles in homedir to dotfiles_old directory, then create symlinks
cd $dir
for file in $files; do
    mv ~/.$file ~/dotfiles_old/
    ln -sv $dir/$file ~/.$file
done

The only drawback is that I have to install syncthing first on a new system and wait for it to copy the sync folder before I can continue.

I’m planning a clean install on my iMac Pro when Big Sur comes out. I’ll be re-thinking everything to that end. For example, I’m considering moving from homebrew to macports for my package manager. I’ll keep you posted!

4 Likes

Love HoM! So great to see more advanced info regards what we can do with our Macs, rather than the default ‘beginner guides’ that you see in newsagencies. And Syncthing looks fantastic. Have already installed it, and am syncing my Downloads folder. Will add more folders pretty soon. Keep it up!

1 Like