Share a folder but not sync immediately, is there a way?

So, im worndering if there a way a device(s) can share a folder with another device, but the other device to immediatly accept the folder (well accept it but not really sync it immediatly), and sync at a later time?

Here is a use case. 2 PCs. Home PC and Work PC. both have syncthing and have eachother added as devices. you have your photos on your home pc, that you want to share with your work pc, but dont actually want to sync it to the work pc immediatly. Only when you actually need to fetch some photos the work pc can decide to sync the folder (since it already had permission from an earlier request). Is this possible?

Im trying to migrate from BTSync, and it has similar functionality where you can share a folder with another client but that client doesnt need to immediately download the folder, it can download it at a later stage (so long as one or more of the other devices with the actual folder is online, if not you have to wait to actually download the folder obviously).

If this can be done, is there any specific Client i can use to get it working? When i share a folder with syncthing (im using the SyncTrayzor client) i get a notification to add the folder on the other clients and there is an option saying “later”, but i have no idea what this actually does (it seems to not do anything besides dismissing the request temporarily).

Any help appreciated.

Syncthing currently has no on demand feature.

But if your Work PC is Unix bases / fuse capable, you can use syncthing-fuse. This will mount the remote Syncthing folder and you can access the files on demand.

1 Like

Hmm, unfortunately its windows based. :frowning:

That sucks, which means i would likely need to use both BTSync and Syncthing at the same time, which i would prefer not to do. Ah well, back to drawing boards for me i guess. Reason for attempt to migrate to syncthing is, BTS doesnt do a very good job of syncing my programming project folders (it overrides and roll back files time to time, which is annoying), and i have heard good things about syncthing for this usecase.

Any plans of bringing such feature into syncthing?

Actually even a simple UI change would be a good start. Obviously when one client shares a folder with another, the 2nd client gets a notification (it obviously knows that theres an incoming request). The share request is displayed on the top of the UI. Clicking “later” only delayes until the next restart (or when ever it feels like) and the notification is persistently showing up. SO instead of showing the folder share notifications at the top, isnt it better to have a separate section to show them, maybe even show them under folders but greyed out (because you havent synced them yet). And if you go this far, i guess its not much more of a stretch to tell the difference between “shared” and “synced” so once shared you can change the state of synced/un-synced freely. sorry, just a suggestion/thinking-out-loud. :slight_smile:

I’m not sure I see the use case for sharing but not syncing a folder? What does it even mean to “share” a folder under those circumstances? You may be looking for “pause a folder” functionality which is somewhere on the horizon probably.

1 Like

If you just want this as a one-time thing. A shares folder-1 with B. B doesn’t want it now but later. As soon as B wants it, it will accept the share and cannot “un-accept”/“unshare” it, than this can be done with the pending share request. You are not the first to request a kind of “pending share request list”.

And as @calmh said, this is very niche, and pausing folders will probably come eventually.

Alright, let me give you my actual use case. Home PC (Home) vs File Server (Server) vs Work Laptop (Work).

I work on a lot of development projects, for lot of clients. I have all of them in client separated project folders. I would like to have them synced between my Home and Work, and also my Server (which will run backups on them etc, and act as a 24/7 client so i dont have a scenario where files didnt sync due to clients not being On). Alright, now, my Work laptop may not have enough memory to sync ALL client folders all the time (we are talking reasonable size projects). So, i want to be able to Sync the current client + maybe some other clients folders where i can steal assets etc to the work Laptop, and have the ability to unsync (pause? and delete? so i get my space back?) and Sync any other client folder when i need them. Obviously the only way i see this happening currently is by remoting into my server and re-share the folders, but this feels a bit silly. This might be a rare usecase? Maybe, but a nice feature to have nonetheless right? You might not think so, which is fair enough :smiley:

So when i said the difference between “share” and “sync” on the other post, let me try re word them. “Authorise” and “Sync”. So, Authorise means that the client has authority from the other client(s) to Sync (download/upload) the folder but the said folder may or may not be Synced. Sync in this sense is to have the folder physically downloaded on your machine and actively pushing/pulling (downloading/uploading) changes to/from other client(s). So having a client that is authorised for a specific folder, said client has the ability to Sync and Unsync then Sync again without any interaction or confirmation from other client(s) since they have authorised this client for the folder already.

I understand the usecase, but I think it’s out of scope of syncthing. I think you just need a sharepoint server or a NFS mount.

You could probably ignore everything in one folder via .stignore. When you need a folder just unignore it and when you don’t need it any more ignore it again and (manually) delete the files from it. But you should probably wait until Delta indexes doesn't play well with changing ignores · Issue #3457 · syncthing/syncthing · GitHub is fixed :wink:

Thaks @Alex that might be a decent [hacky] way to go about it.

That reminds me, i have a couple of small questions about #include on .stignore.

Can anyone confirm if you can use wildcard includes using one line?

So for example if i add the following: #include */project-ignore-file.txt

And say my folder has 3 subfolders and 2 of them has project-ignore-file.txt, would the above line find both of them and include them on the ignore list? obviously i need to have project-ignore-file.txt populated accordingly in each of the 2 folders and these files will just add ignore rules for some project files (like IDE settings/media/etc).

Secondly, i understand that any rules in an #include file still executes as it was in the share root folder. But, is there any way to add some functionality for that file to know the folder its in? For example: i have a share myShare, and the share has a subfolder folder1. myshare/.stignore:

 #include /folder1/project-ignore-file.txt

lets say that there is a folder /myShare/folder1/ignore that i want to ignore (nothing else). in current implementation myShare/folder1/project-ignore-file.txt:


What i propose myShare/folder1/project-ignore-file.txt:


where @ represents the current folder (should be fairly simple to inject in when you scan from #include). Obviously @ can be replaced by what ever the devs see fit, just a suggestion.

No, there are no wildcards for ‘#includes’, and patterns are either anchored at the root of the folder (where the syncthing folder starts no matter if its an include or not), or unanchored in general and get matched no matter which folder they are in.

Alright, thanks for clarifying @AudriusButkevicius. Hope you dont mind, i will post these 2 as requests in the feature request section. :slight_smile:

Maybe if someone guides me on how to run/test from git project, i could probably even play around with it and add said features (assuming you guys are ok with a complete stranger contributing).

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