Selective Sync?

Fixed link:

1 Like

It would be helpful and I think straight forward to have a setting with which to prevent the sync, but allows to see e.g. as a list what can be synced and to start actually the sync of an object on demand, i.e. by clicking on it.

I am new to syncthing and have replaced other solutions with syncthing for my use cases. I think this feature would be really nice. But, for what I understand the only lacking part is a gui that helps the user update the .stignore file, am I right? I have tested a bit by manually updating the .stignore file with different directories and it seems to work as I expect. (e.g. adding “/test/” will ignore any updates in the test directory, both incomming updates and outgoing updates)

The GUI should be a tree with selectable directories, similar to e.g. Dropbox. Default all directories are checked = selected. If I uncheck a directory the .stignore should be updated with one single line for this directory.

If I am right, this feature is probably quite easy doable and do not need any update in the core, just in the GUI?

You do, as the way it is now, ignoring everything apart from a/b/c/d does not work, as a gets ignored because the pattern does not explicitly match a or a/b and they both get ignored.

Yes, but that was not my suggestion. The suggestion was to ignore the directories not checked. This means that the default is that a directory is synced but it is possible to not sync it.

It is of course possible to do it the other way around, to ignore all by default and adding selected directories only. However in that case that you select only a directory deep down, as in your example above where the user only wants the directory /a/b/c/d to be synced, the .stignore file needs to look like:


The point is that this only works while you are not using **, when you are, it’s complete disaster and impossible to predict. See this, this and this

I have the UI implemented here, the only thing that was missing from completing this is tests, and the actual ignoring part.

That is really cool! Sorry if I am to naive now, but one approach would still be the suggestion above, using the rest api to update the stignore according to the suggestion. Of course a user can update the stignore manually and destroy it, but a warning in the docs might suffice to at least be a proof of concept and get feedback from other users - since the code is close to finalized?

.stignore is already updatable from the web UI, it’s just in a form of a text box. The problem using the tree selector ui with the current setup is that we’d have to do a lot of pattern expansion which could potentially result in a millions of patterns which would be hard to consume.

1 Like

I did not get why there would be millions? The number of excluded directories would never be millions would they? Each excluded directory will have exactly one pattern, and in some rare cases like including a deep down directory only, a couple of extra “always include” patterns? I do think we misunderstand each other, or maybe I don’t see the problem due to beeing new at this.

Anyway, if I can be of any help, let me know. This feature is vital imho.

If you read the threads it’s not 1 pattern per directory. If I want to only sync a/b/c/d, that requires 2 patterns per directory level.

You can take a crack at the branch that I’ve linked. Though I suggest you first read through it to understand.

Yeah, this still lives in a branch on my side as well, it just needs some love and other things came between…

Jorgen, Apologies if I missed it in here and its already been looked into, but what abotu reversing the logic a little?

Add a .stinclude file which if it exists will only synchronize folders or pattern matches in there.

For instance, I am trying to cut the cord from my TV but my wife has an addiction to a Soap Opera she watches daily. I have a friend who is recording the show from his OTA (I have no line of sight) on his Windows Media Center box. Media center stores ALL show content in a single folder.

So I was hoping to setup a ST job to synchronize JUST the “Soap Name*.wtv” from his machine to mine, along with the IgnoreDelete option. Then he tells Media Center to only store like 5 episodes max, and Media Center auto deletes anything older than that. But by then, I should have synchronized it to my server at home and even if he deletes it, I keep a copy until my wife watches it and deletes the local copy.

The problem with all this is my friend has like 20 shows he records, and with ST there is no easy way to ONLY synchronize 1 show I want.


Ignore everything (*)
Exclude X from ignores (!soap**)
1 Like

Just as a motivator: I’m really looking forward to selective sync! It would be awesome to just setup a single folder (with all my files in subfolders) between three computers and choose from the GUI which subfolders I need on individual computers. I the need for another folder arises later, I can just check it. No need for setting up another folder on both ends.

Any chances we’ll see GUI for folder-level ignores? (Similar to Dropbox selective sync?)

Would help a lot for normal users (me:) who are confused by the text ignore patterns.

Hi, for me it is really important that have something like Dropbox:

  • Selective synchronize folders and subfolders
  • Be able to download and share individual files or folders.
  • Web interface and applications let do it.

Once it is possible, I will really move from Dropbox and Seafile.

Thanks in advance and congratulations for this great app.

So perhaps we need to combine the 2 options people are discussing.

  1. Add a feature to SyncThing called “Sync on Demand” that you flag on the SOURCE.
  2. When a Client/Destination sees this flag, it immediately sets up an Ignore everything (*) rule.
  3. When the Client/Destination (hopefully using a GUI) flags a file/folder for download/sync, it adds the “Exclude X from ignores (!soap**)” (Taken from Audrius response to me)

Seems like this uses the mechanisms already in place as much as possible and technically number 1 and 2 could be optional if you have a way for the client to quickly add the ignore flags.

// DON't ignore the following dirs (i.e. DO sync them):

// Ignore all the rest

this method like white-list … also works for me

I also have a thousand sub-folder in a big folder , but I always update some of these sub-folders one time…

so I just need to update the stignore, and then I click rescan , it’s done…

1 Like

I think really could be used in many of the cases people need “selective sync”. It exposes all the files in a normal Syncthing folder to the SyncthingFUSE user, but this can choose which files he will get. By default is none. Also the SyncthingFUSE user cannot modify the Syncthing user’s folder, so it’s a kind of file browser and on-demand file downloader on top of Syncthing.


Any news on this? I would really appreciate this feature. I’m using ignore patterns, but this text-based solution really looks out-of-place in an otherwise user friendly UI.

I also use file-level excludes sometimes. Maybe it can be done on demand on specific folders, rather than by generating the entire resource tree.

If I had more time I would definitely try to take the branch and complete it. What is its status anyway? Still half-done, or somehow broken by subsequent updates?

1 Like