# Sync nested folder

**URL:** https://forum.syncthing.net/t/sync-nested-folder/23707
**Category:** Support
**Created:** [January 26, 2025, 9:21pm UTC](https://forum.syncthing.net/t/sync-nested-folder/23707 "2025-01-26T21:21:41Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![vuthing](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/v/e9c0ed/32.png) [@vuthing](https://forum.syncthing.net/u/vuthing)
#### Post date: [January 26, 2025, 9:21pm UTC](https://forum.syncthing.net/t/sync-nested-folder/23707/1 "2025-01-26T21:21:41Z")

</div>

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

---

<div class="post-metadata">

### Author: ![chaos](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/c/9d8465/32.png) [@chaos](https://forum.syncthing.net/u/chaos)
#### Post date: [January 26, 2025, 10:46pm UTC](https://forum.syncthing.net/t/sync-nested-folder/23707/3 "2025-01-26T22:46:31Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![mraneri](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/m/b19c9b/32.png) [@mraneri](https://forum.syncthing.net/u/mraneri)
#### Post date: [January 26, 2025, 11:04pm UTC](https://forum.syncthing.net/t/sync-nested-folder/23707/4 "2025-01-26T23:04:38Z")

</div>

> [@chaos](#):
>
> Three Devices named NAS, iPhone and Android

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.

---

<div class="post-metadata">

### Author: ![tomasz86](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/t/96bed5/32.png) [@tomasz86](https://forum.syncthing.net/u/tomasz86)
#### Post date: [January 27, 2025, 1:43am UTC](https://forum.syncthing.net/t/sync-nested-folder/23707/5 "2025-01-27T01:43:25Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![mraneri](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/m/b19c9b/32.png) [@mraneri](https://forum.syncthing.net/u/mraneri)
#### Post date: [January 27, 2025, 2:17am UTC](https://forum.syncthing.net/t/sync-nested-folder/23707/6 "2025-01-27T02:17:58Z")

</div>

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…

 ![IMG_0326](https://forum-uploads.syncthingcdn.net/original/3X/5/3/539a07e8cfd9473e21d286e2ab4fecf3cd03074f.jpeg)

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.

---

<div class="post-metadata">

### Author: ![tomasz86](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/t/96bed5/32.png) [@tomasz86](https://forum.syncthing.net/u/tomasz86)
#### Post date: [January 27, 2025, 2:34am UTC](https://forum.syncthing.net/t/sync-nested-folder/23707/7 "2025-01-27T02:34:12Z")

</div>

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).

---

<div class="post-metadata">

### Author: ![mraneri](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/m/b19c9b/32.png) [@mraneri](https://forum.syncthing.net/u/mraneri)
#### Post date: [January 27, 2025, 3:07am UTC](https://forum.syncthing.net/t/sync-nested-folder/23707/8 "2025-01-27T03:07:07Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![vuthing](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/v/e9c0ed/32.png) [@vuthing](https://forum.syncthing.net/u/vuthing)
#### Post date: [January 27, 2025, 6:45am UTC](https://forum.syncthing.net/t/sync-nested-folder/23707/9 "2025-01-27T06:45:27Z")

</div>

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

---

<div class="post-metadata">

### Author: ![grifttt](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/g/e47774/32.png) [@grifttt](https://forum.syncthing.net/u/grifttt)
#### Post date: [February 8, 2025, 2:52pm UTC](https://forum.syncthing.net/t/sync-nested-folder/23707/10 "2025-02-08T14:52:21Z")

</div>

I tried to achieve a similar goal:

> [@Workaround for multiple .stignore?](https://forum.syncthing.net/t/workaround-for-multiple-stignore/22483):
>
> Hi, I have 3 devices: PC, Laptop and NAS. The NAS is permanently online, so I always place the NAS between the PC & Laptop when syncing (the Laptop & PC never sync directly to one another). I am using Linux, so everything worth backing up is under /home/username. There are 3 categories of files & folders in my /home/username folder: Profile Data (Desktop, Documents, Music, Pictures, Videos, Projects, etc.) Local Config Data (.config, .local, some of my own folders as well, etc.) Other syst…

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 🤞

---

<div class="post-metadata">

### Author: ![system](https://forum-uploads.syncthingcdn.net/original/2X/0/0b50e0a202b22ae6a67190759e8c868805b8ed9f.png) [@system](https://forum.syncthing.net/u/system)
#### Post date: [March 10, 2025, 2:52pm UTC](https://forum.syncthing.net/t/sync-nested-folder/23707/11 "2025-03-10T14:52:58Z")

</div>

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