Sync nested folder

Hi, I have 4 devices, 1. NAS, 2. Windows, 3. Android, 4. iPhone

On Windows, I have a folder with photos that contains many subfolders:

photos

|_ Holiday 1

|_ Holiday 2

|_ … etc.

|_ iPhone

|_ Android

The photos folder is synced with the NAS in the same structure.

I want to sync Android and iPhone with the NAS. But I dont want to sync the complete photos folder with the iPhone and the Android, but only the Iphone folder with the iPhone and the Android folder with the Android device.

I considered creating a sync for the Android folder on the NAS and sync it with the Android Camera folder and likewise with the iPhone. In this way, the Andorid photos would be synced with NAS and Windows and would end up in the photos/Android folder on NAS and Windows.

I understood that officially one should not have a sync folder within another sync folder. The above scheme would mean that the Android sync folder on the NAS is within the photo sync folder on the NAS.

Can this work?

If not, how can I make this work?

Maybe, I should exclude the Android and Iphone folders from the photo folder sync between Windows and NAS and sync the Android folder between Android, NAS and Windows (within the above folder structure)? Would that work?

Thanks for your help

vu

What I chose was to create a new shared Folder for each directory, so that I could choose which Devices each one would be shared with. Among other advantages, the configuration is simple for me to understand and work with. It cost me perhaps ten extra minutes of Syncthing configuration.

If you choose to sync a Folder that’s already within a shared Folder, but with a completely different Device…that should work.

So in your environment:

  • Three Devices named NAS, iPhone and Android
  • NAS syncs a specific Folder with iPhone
  • NAS syncs a specific Folder with Android (and that folder contains the shared Folder with Device iPhone)

I’m a big fan of simple configurations.

But they have 4 devices. And presumably they want to sync everything with that 4th device.

I would NOT setup nested sync folders.

I would share the main folder with all 4 devices and setup an ignore pattern on the iPhone to ignore all but the iPhone folder and an ignore pattern on Android to ignore all but the Android folder. All files will sync between the windows machine and the nas and the phones will sync their respective folders with the windows machine or the NAS.

I believe this is the simplest configuration.

1 Like

I don’t think using a single large folder with ignore patterns is going to work in this case, because the paths on the phones are likely hard-coded (e.g. on Android it’s going to be Camera/DCIM on the internal storage, etc.).

With nested folders, the general rule is not to share both the parent and the nested child folder between the same devices (so that there is no overlap in synchronisation). If you do have to share both of them like that, then at least you should ignore the nested folder in its parent’s ignore patterns.

1 Like

Can’t you discover what the Android path is and exclude it on the android Syncthing?

Maybe this is an android only problem, but I’m doing this exact thing on the iphone.

I automatically transfer images from my Sony cameras. I only share the B sub folder (card slot 2) and then only the JPG files. (Not the raw files)

This works great for me. It’s too bad if this can’t be done on android…

The only thing I can’t figure out is when I delete a subfolder underneath B on the computer, the folders are emptied but the empty folders remain presumably due to some hidden file created by IOS that I can’t figure out what it is. But aside from this it works fantastic. (This problem is going to occur regardless of the method used.

I think part of the problem is that you likely want to name a photo folder coming from a particular phone something else than just DCIM, and in that case, there is no other way than to share the folder directly (so that you can point it at a different path and name on other devices).

Then I guess it depends on the directory structure on the source side and whether the user has control to adjust it. I think if they’re trying to backup photos from the phone (camera roll?) to the NAS/windows machine then yeah it’s probably difficult.

In my case I’m trying to get images from the NAS TO my phone. So perhaps it can work. But perhaps not.

Dear all,

Thank you for all you helpful comments.

Some comments:

  1. I haven’t tried my original setup yet, so I don’t know if anything will or will not work. I thought it better to ask beforehand.

  2. The holiday folders and the Android and iPhone folders are all subfolders of the phone folder.

  3. I want to sync the Android/DCIM folder from Android to NAS.

  4. There are many folders under photo and I don’t want to create separate sync profiles for each of them. Only separate sync profiles for photo, android and iPhone, if possible.

I think, I will try syncing the photo folder between NAS and Windows while excluding the Android (DCIM folder) and syncing the DCIM folder (within the photo folder) between Android, NAS and Windows. Any comments whether this would cause problems?

Thank you

Vu

I tried to achieve a similar goal:

The cleanest solution would be if syncthing allowed sharing multiple instances of the same source folder, but with different ignore patterns, which, to the best of my knowledge, is still not possible as of today.

If that was possible, you could create 3 folder shares for your same ‘photos’ folder:

  • Syncthing Folder 1: (photos) - exclude iPhone & Android subfolders

  • Syncthing Folder 2: (photos) - only include Android subfolder

  • Syncthing Folder 3: (photos) - only include iPhone subfolder

This would give the flexibility to configure the shares any way you could think of.

I continue to hope that this will one day be possible in syncthing :crossed_fingers: