💾 Archived View for perso.pw › blog › articles › syncthing-single-file.gmi captured on 2024-07-09 at 00:31:17. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2023-05-24)

-=-=-=-=-=-=-

Configure syncthing to sync a single file

Comment on Mastodon

Introduction

Quick blog entry to remember about something that wasn't as trivial as I thought. I needed to use syncthing to keep a single file in sync (KeePassXC database) without synchronizing the whole directory.

You have to use mask exclusion feature to make it possible. Put it simple, you need the share to forbid every file, except the one you want to sync.

This configuration happens in the `.stignore` file in the synchronized directory, but can also be managed from the Web interface.

Syncthing documentation about ignoring files

Example

If I want to only sync KeePassXC files (they have the `.kdbx` extension), I have this in my `.stignore` file:

!*.kdbx

And that's all!

Note that this must be set on all nodes using this share, otherwise you may have surprises.