in general (~98%) the laptop only should receive the state of the desktop.
In some situations some changes (like of some files or a folder) done on the laptop should be “synced” back to the desktop.
Is there a strategy for such a scenario?
or a hack like “forcing a sync” back from a receive-only device to a send-only device for some files and folders?
Given the scenario above, setting the desktop to “Send Only” and the laptop to “Receive Only” really isn’t a good fit.
One strategy would be to use two Syncthing folders…
Desktop:
/home/user/A
/home/user/B
Laptop:
/home/user/A
/home/user/B
Folder A would be “Send Only” on the desktop and “Receive Only” on the laptop.
Folder B would be “Send & Receive” on both devices.
Anytime the laptop needs to sync something to the desktop, drop it into folder B. On the desktop, move files/folders from B to A whenever they should no longer be modified by the laptop.
Another strategy would be to keep the single /home/user/folderX …
But set both sides to “Send & Receive”, and then use filesystem permissions to control what can and cannot be deleted by the laptop.
The downside is that there will be unresolved sync errors if the laptop tries to delete/change a file/folder that it doesn’t have permission to, but then that should only happen no more than ~2% of the time.
No, because it’d defeat the intended purpose of a device setting a folder to “Send Only” if the recipient can arbitrarily override the sender.
I can’t think of a file transfer or sharing tool that can do what you’re asking out-of-the-box.
folderID="test"
syncthing cli config folders "${folderID}" type set sendreceive
sleep 30s
syncthing cli config folders "${folderID}" type set receiveonly
which is not nice but does what I “need” in some sense
Or you can use ‘send/receive’ on both devices, with rules or combinations on ‘ignore patterns’ on both devices. If the type and name of files that it handles allows it