Always sync existing files

I’ve tried to find a way to override the ignore patterns that I’ve made so that files that already exist on the local device are always synced.

The example:

Devices: Server / Desktop / Laptop

Server & Desktop contains all documents. Laptop only contains 2 folders (and subdir).

Folder structure:

    Boring Project

So Laptop only contains the folders Tom & Work (and associated subdir - Tax & Boring Project). This is due to storage limitations on the laptop. Now whilst away on holiday when having to renew the car insurance a new file is made: “Car\Insurance\Quote.docx”

Current Ignore Rules:


So existing ignore rules exclude all dir & subdir except Tom & Work (and subdir). I’m after a rule that would allow syncthing to recognise the Quote.docx file locally and sync that (send) to the server and desktop. Then if a change was made to the file on the server or desktop, that would propagate back to the laptop as it’s a pre-existing file on the laptop (receive). It would do this without having to manually specify in the ignore rules every single file, just that all local files in the target folder (in this case Documents) would be synced regardless of the ignore all pattern.

Alternatively any sufficiently straight-forward work around anyone has to this problem would be greatly appreciated.

I would love it to be as simple as:


… but I’m a realist. Thanks in advance!

Sorry but your question is super unclear. You want stuff ignored but synced, these two are mutually exclusive.

If you want something synced, you don’t ignore it.

You can unignore individual files before ignoring the rest, but that would have to be done on both sides.

Sorry for being unclear, Let me reframe.

So in the above example, let’s say the insurance folder is 200GB. The laptop only has a 128GB SSD for everything (OS, programs, documents)

So I can’t sync the whole folder to the laptop, most of its contents is historical (old), so I can live without it being synced. Now when I’m on holiday with the laptop and the insurance company calls, I create a new document on the laptop with the details, this being QUOTE.docx

When I return home, the insurance company might call me and so I want the document on the desktop (sent) so I can view and update it.

Now I have the original on the laptop and the updated on the desktop. Ideally these would be synced.

So, whilst I don’t want the whole Insurance folder synced to the laptop, I do want any files I create on the laptop to be synced. I also want this to happen without having to go into syncthing and manually designate individual files to sync, that would remove the hands off automatic syncing benefits, especially for the more computer challenged in my family.

So options:

1 - sync all insurance folder (Can’t too big)

2 - create new sync rule, each and every time I make a new file (too time consuming, no benefit to syncing)

3- sync only desired folders, ignore unneeded (large infrequent) folders BUT include any files currently on the local machine.

Option 3 allows me to sync my frequently used folders always, to not use up all my disk space by not syncing infrequently used folders whilst ensuring that all files on the laptop ARE synced and thus are the most up to date version of themselves.

I don’t know of a way this can be achieved with the current ignore rules options and I think it would require an option include in a sync all local files (in the designated folder- Eg. Documents) hence my example of: !ExistingFiles

I hope that clears up my aim. Obviously if I’ve overlooked a way this can be accomplished in the current version, I’d be very happy for someone to set me straight on this. Once again, thank you to those in the community who may be able to help!

If you want everything synced, except for old stuff, I’d propose moving all the old stuff into subdirectories called “archive”. Thus ignore rules get super easy (just archive) and you can keep your structure except for the archive dirs (e.g. “Documents/Car/Insurance/archive”). Or go the other route, create subdirectories called e.g. “laptop-sync” when you want to sync something in an ignored dir and have


as your ignore patterns.

Thank you for you’re reply.

Firstly, the archive idea is a good one for those folders which are mostly old files. Unfortunately most of the folders I need to do this for are in active use (family members other than the one that owns a computer, we do share).

It seems clear that syncthing doesn’t yet have an inbuilt option with the elegance I was aiming for to solve this problem. I have however been playing with an idea I had just a few hours ago that seems to be an acceptable workaround (though I would’ve really preferred to keep things within syncthing)

Solution I’ve found is this:

Use of another program called DropIt. I’ve used it before for simple file transfer automation (within a single computer environment). DropIt is capable of creating a list containing the file names of all existing files (with the ! prefix)

This file is then used in conjunction with some standard ignore rules to allow all existing files within the synced directory to be synced (both ways) regardless of parent directory default sync behaviour (ignore vs include)

My example ignore rules (in .stignore)

//This is to include some folders ALWAYS
//This list is generated by dropit of existing files on computer (within the desired folder- in this case Documents), these are then synced (both ways)
#include DropItList.txt
//This excludes all other files
//This includes all folders (empty) so as to make it easier to know where to place a new file.

So now, in my original example, when I create the Quote.docx file on the laptop, i can place it in the pre-existing Insurance folder and have it synced between all computers even though Insurance is not normally synced on the laptop.

It would still be more elegant to have just a !ExistingFiles tag that could do this automatically within syncthing, but the workaround will suffice in my situation. I hope this helps for those who find themselves in a similar situation of limited storage space on some devices.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.