a strategy like receive only BUT if needed with the possibility to force a sync of some files/folders back to sender

  • Desktop: Send-only /home/user/folderX
  • Laptop : Receive-only /home/user/folderX

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. :wink:

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.

  • Desktop: SendReceive /home/user/folderX
  • Laptop : Receive-only /home/user/folderX

Currently I use a script on the laptop like

(when the desktop is online)

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

Thanks for you idea

‘send/receive’ on the desktop is something that doesn’t feel so good (I would like to have it send-only → security/control about the “state-changes”)

my current opinion is, that there is “too much risk” if the ignore pattern is forgotten on a new device (setup) or the logic of folders and naming changes (Could we have a .stsharedignore file that gets synchronized between all the devices? · Issue #7311 · syncthing/syncthing · GitHub)

  • is would mean a lot of work - identify all changes and cleaning up again … on the desktop

regarding the ignore pattern

  • I haven’t found a way to specify a pattern for changed files in the last 20 hours (in my scenario only the time not the name is relevant for sync)

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