About me: My name is Solène Rapenne, pronouns she/her. I like learning and sharing knowledge. Hobbies: '(BSD OpenBSD Qubes OS Lisp cmdline gaming security QubesOS internet-stuff). I love percent and lambda characters. OpenBSD developer solene@. No AI is involved in this blog.

Contact me: solene at dataswamp dot org or @solene@bsd.network (mastodon).

I'm a freelance OpenBSD, FreeBSD, Linux and Qubes OS consultant, this includes DevOps, DevSecOps, technical writing or documentation work. If you enjoy this blog, you can sponsor my open source work financially so I can write this blog and contribute to Free Software as my daily job.

Configure syncthing to sync a single file

Written by Solène, on 28 January 2023.
Tags: #linux #syncthing #nocloud

Comments on Fediverse/Mastodon

Table of contents

1. 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

2. 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.