Regarding Send Only / Receive Only

I have a folder on my Mac ~/Username/Pictures. It contains a mish mash of usable information and garbage (like mobile device photos that are simply notes.)

That folder is in a send/receive state and syncs with a folder on my Ubuntu server to keep a backup of all files in this folder.

Under ~/Username/Pictures, I have a folder called “Send to Plex” It is ignored by the previous sync setup.

Whenever I find an image in my Pictures folder that I find that I’d like to include in my media server, I drag it into the “Send to Plex” folder. The intention is to have that file automatically copied to the Plex folder for the Plex library I’ve created. Then, I would delete it from my Mac permanently. Subsequent backup routines would protect it from loss at the server level.

I’m wondering if Syncthing is the wrong tool for this since there seems to be some added risk of reverting or overriding file states on folders that are set to Send Only or Receive Only.

Logic would say, set the Mac folder to Send Only and the Ubuntu Plex folder to Receive Only, but it seems that’s not actually the intent.

Would it make sense to use a different type of routine to accomplish what I’m trying to do? I could simply drop the keepers into the SMB share on the server, but I’m not always on the network where the server is located.

Thanks for the insight if you have any.

You could have “normal” folders on both sides plus a job on the server (triggered periodically or otherwise) which moves content from the transfer folder to a permanent location. This way you could be sure to have a copy on the server and you’d have an elegant way to the delete the copy on the Mac as well.

2 Likes

I see 2 solutions, both related to File Versioning ( https://docs.syncthing.net/users/versioning.html ), next to defining the Mac as Send only, and the Ubuntu Server as Receive Only.

  • Setup Trash Can File Versioning (Rubbish bin) with no cleanup (set to 0 days). At the Ubuntu server, you should make sure the (hidden) .stversions folder is included into the backups. Whenever a file is deleted or replaced, it will be moved to the .stversions folder, where it will be kept forever

  • Setup External File Versioning Whenever a file is deleted, a script is executed. This script could be used to copy the file at the Ubuntu Server to a permanent location outside the Synchting folder (an example is provided in the docs)

Just to provide another option, if you use rsync, you could achieve this with the same number of manual steps. rsync has a --remove-source-files option which makes it delete the files it transferred. Right now you have 2 manual and 1 automated steps in your ideal flow:

  1. Drag the files into the “Send to Plex” folder (manual)
  2. Sync (automated)
  3. Delete the file from Mac permanently (manual)

You could create a one-line shell script that will run rsync and your flow becomes:

  1. Drag the files into the “Send to Plex” folder (manual)
  2. Run the script which syncs and when the files are completely transferred, deletes the files (manual but a single step)

There’s a drawback though, you might need to wait for the script to finish before moving away from your computer since it won’t know to continue if the connection drops, etc. It might still be okay since you also won’t have the overhead of having to verify that the sync was completed.