Ignore patterns help - Sync only contents/files of any subfolder but not the actual subfolder itself


I’m wondering if this is achievable via Syncthing. I’d like to only sync the contents of each and any subfolders within the directory I have added to syncthing as a synced folder.

So I have: Remote Syncthing:

Synced Folder A, Subfolder A, abc.png

What I would like to appear on my local Syncthing:

Synced Folder A, abc.png

I have had a look at previous topics but not sure how to differentiate between subfolder and folders and then also not completely ignore that subfolder

I don’t think that a proper two-way synchronisation like that is possible with Syncthing, unless each subfolder uses some kind of a separate file naming scheme, so that you can ignore each of them separately, e.g. folder1 has files named folder1_abc.png, folder 2 has files named folder2_abc.png, etc.

Otherwise, what you can do though is to add each subfolder as a separate folder to Syncthing, set all of them as Send Only, and then on the other side add them all pointing at the same path. This way they all will push files into the same, single folder. However, they also will not accept any changes from the remote, so there is a drawback to this.

Hi, thanks for helping me with this.

The sub-folders won’t exist right now and are created when they are needed, so I won’t know what the subfolders will be and want it applied to any subfolder in the future.

The files that will appear in the subfolders do have the same name as the subfolder if that’s what you mean.

So a folder named mypictures will appear with a file mypictures.png the next folder will be myphotos and a file named myphotos.png

This is the problematic part then. To keep things simple, what I would probably personally do is to just synchronise everything as usual using the parent folder, and then write some kind of a script on the remote machine that would periodically move/copy the files to main, single folder.

Yeah I figured as much, I have written a simple script and I will try and install syncthing-hooks with node.js to try and use this as the trigger to execute the script.

I’m not all too good though with installing this app with node.js, doesn’t make any sense to me! I just know how to install things through unRAID. I will figure it out someday!

Thanks for your help.

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