ivo1467
November 23, 2025, 8:16am
1
I want to sync the internal storage of my phone to my pc, but i want to include only specific folders and files and exclude everything else. Also, i want to exclude sub folders from the included folders. This is what i use for ignore patterns:
!Documents/
Documents/PDF/
!Books/
*
It works for syncing only included folders: !Documents/,!Books/, but it doesn’t work for excluded folder: Documents/PDF/
calmh
(Jakob Borg)
November 23, 2025, 8:17am
2
Patterns are matched in order, first match wins. !Documents/ will match before it sees Documents/PDF/.
1 Like
ivo1467
November 23, 2025, 9:47am
3
i tried this but it still didn’t work:
Documents/PDF/
!Documents/
!Books/
*
tomasz86
(Tomasz Wilczyński)
November 23, 2025, 10:19am
4
The patterns look correct. Please keep in mind that ignoring files afterwards won’t delete those which have been already synced before adding the patterns, i.e. you need to delete them manually.
3 Likes
ivo1467
November 23, 2025, 3:23pm
5
Is there option to delete excluded folders that are already synced? Something like --delete-excluded option for rsync.
Not directly, but it can be done. And it is a bit complicated. And first we need to establish some naming conventions in Syncthing lingo:
A “directory” is a placeholder in the filesystem. It can for example contain other directories and files.
A “folder” is an entity you create in Syncthing. It is typically shared between devices.
Make sure that you have the ignore patterns on the phone, NOT on the PC. That’s the only way I know to get below scheme to work.
Remove the folder (but NOT the directory) from Syncthing on the PC.
Add it again (and make sure you use the same directory) and set the folder type to “Receive Only".
Wait for the scan to finish.
Wait for the comparison to take place.
When you get the ‘Revert local changes’ button, press it. This will cause the content on the PC to be identical to the non-ignored stuff on the phone.
Each time you have adjusted the ignore pattern, repeat the steps above.
Try it out on a small test directory for which you create a separate Syncthing folder. You don’t want to experiment on “production” data…
1 Like
ivo1467
November 24, 2025, 6:45am
7
There should be a more simple solution for this. I will just delete folders manually.
calmh
(Jakob Borg)
November 24, 2025, 7:27am
8
That is the simple solution, indeed.
system
(system)
Closed
December 24, 2025, 7:28am
9
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.