I’m really loving this initiative!
Syncthing has ignore mechanics, but I’ve always missed the file oriented selective sync. So it became (for me) a requirement that each Device must have enough storage to sync Folders completely. This means expensive storage upgrades for our MacBooks and, depending on storage growth, it may not be something I can do forever.
In 2021 I attempted to solve this by building a Syncthing client wrapper, with the ability to sync placeholders files akin to Resilio Selective Sync (with the ultimate goal of creating a MacOS FinderSync extension. One of the reasons I abandoned it is the inability to delete (an ignored file) from the directory tree of the global model, without first downloading the file.
When playing with Synctrain on macOS I ran into the following.
- I share a folder to Synctrain on macOS
- Synctrain accepts and chooses to sync only “Selected files”
- I decide to sync a subfolder with Synctrain
- I browse this subfolder in the Finder, all good!
- I try to “unsync” this folder in Synctrain
- Error: “The synchronization setting for this item cannot be changed, as the local copy is the only copy currently available.”
The reason this happens is that by browsing in Finder new .DS_Store
files are generated, which I ignored on the remote devices like this: #include .stglobalignore
. The file looks like this:
// https://forum.syncthing.net/t/useful-stignore-patterns/1175
// Case insensitive match with (?i) because on macOS the FS is case insensitive
// I need the ignore rules to be exactly the same on all nodes,
// including the NAS, which has a case sensitive FS
(?d)(?i).DS_Store
(?d)(?i).Spotlight-V100
(?d)(?i).Trashes
(?d)(?i).DocumentRevisions-V100
(?d)(?i).TemporaryItems
(?d)(?i)$RECYCLE.BIN
(?d)(?i)desktop.ini
(?d)(?i)Thumbs.db
(?d)(?i)@eaDir
When I manually remove the .DS_Store
I can successfully unsync the subfolder again. Not sure why, because I have “Ignore certain system files” checked in “Advanced settings”.
I realise your selective sync implementation relies on the .stignore
file, and it’s a bit tricky. But would it be possible to append/prepend user config to the .stignore
in addition to the lines managed by Synctrain? That way I could add my #include .stglobalignore
line and have my ‘base ignores’ consistent on all Devices.
On the iOS version I see it’s possible to create ignore rules manually, in “Advanced folder settings”. But this seems to be enabled only for Folders synced completely (not selectively synced Folders).
Would be great if adding ignore rules would be possible for selectively synced Folders would be possible on both macOS and iOS.