How do I make syncthing ignore all subdirectories?

Hi,

I want syncthing to synchronize all *.jpg and *.mp4 but ignore everything else. I do not even want other clients/instances to create subfolders.

How do I do this?

PS: I have 28k folders and ~8k files that need synching but my Android client has inode failure errors at approx 20k+ or something like that…

Welcome here @SubZero5 !

Please study Ignoring Files — Syncthing documentation . I think it will do the trick to add the following to .stignore.

// Sync all images. Case-insensitive matching.
(?i)!*.jpg
(?i)!*.mp4
// Ignore everything else.
*

It will sync matching files in all directories and preserve the directory structure. In case you want to sync only matching files in the root of your folder, then I think t following will work for you:

// Sync all images in the root of the folder. Case-insensitive matching.
(?i)!/*.jpg
(?i)!/*.mp4
// Ignore everything else.
*
2 Likes

@martinleben thank you for your response.

I do not want Synching to recreate any/the directory structure and/or sync the files inside the directory structure. I want it to only sync the *.{jpg,mp4} files in the shared root folder as from time to time local file count between 2k~200k.

Is this scenario even possible?

PS: I have tried a couple of times but Android’s inodes limit kills the transfers all together…

If not possible, I am going to plan sharing a new folder that holds only the images and the video files to be synchronized… :thinking:

That sounds like what Martin described above.

// Sync all images in the root of the folder.
// Case-insensitive matching.
(?i)!/*.jpg
(?i)!/*.mp4
// Ignore everything else.
*
1 Like