Skip to main content

TCFJR

Tag: Tech

Syncthing Fix

I use Syncthing to synchronize files between various systems in my extended homelab. There are currently five systems using Syncthing - a primary NAS server and a backup NAS server based in Texas, a laptop running Ubuntu Server 24.04 currently based with me in Ireland (and known as the Blackrock server), my personal Asus laptop running Windows 11, and a Digital Ocean VPS running Ubuntu Server 24.04. (I have a couple of other devices in the Tailnet - my Pixel 6 phone, and the travel Chromecast.)*

Because of bandwidth and disk space concerns, not all systems sync all of the directories. The primary NAS has a single ‘media’ directory that has subdirectories for various categories - TV shows, Movies, Audio Books, Music, etc. The TV content is actually kept in three separate directories - tv for main content, tvextra for less visited, more niche content, and tvspecial for a couple of series that seem to cause Plex a lot of grief. The Blackrock system syncs most of these directories, but not all.

From time to time, a TV series is added to the main ’tv’ directory at first, but over time it gets reclassified as a ’tvextra’ series. Originally, I’d use Sonarr to move the series from ’tv’ to ’tvextra’, and since both of these directories are under the ‘media’ directory the move is made using hard links, making the move instantaneous.

However, this causes Syncthing on the Blackrock server to: a) delete the series directory from ’tv’; and b) recopy the series directory from the NAS to a new directory under ’tvextra’. In the end everything winds up where it should be, but at the cost of time and bandwidth.

The obvious soluttion to this is to: a) pause sync on the Blackrock server; b) manually move the affected series directories from ’tv’ to ’tvextra’ on both the NAS and the Blackrock server; and c) restart the sync. Both sides of the sync will spin while they figure things out, but after a minute or two they both report a full sync, with no need to copy anything from one server to the other.

* Note: I just added my Samsung Tab A9+ to the tailnet - handy when you’re out and about but the phone isn’t quite big enough to meet your needs. It now syncs the Obisidian vault and the KeePass database folder.

Vim Note

I use the vim editor to write these posts, and prefer not to use vim’s automatic line-wrapping. There are times when longer lines are necessary, so I like to manually wrap lines when needed.

In blog posts like this, paragraphs are separated by a blank line. To wrap the lines in a single paragraph, use this key sequence:

:gq}

: opens command mode, gq is the wrap command which must be followed by a movement command. } moves to the next empty line. Put them altogether and the current paragraph is wrapped to the defined line width, which defaults to 80.