# Send and Delete

**URL:** https://forum.syncthing.net/t/send-and-delete/16272
**Category:** Feature
**Created:** [January 30, 2021, 1:49pm UTC](https://forum.syncthing.net/t/send-and-delete/16272 "2021-01-30T13:49:09Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![dala](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/d/ac8455/32.png) [@dala](https://forum.syncthing.net/u/dala)
#### Post date: [January 30, 2021, 1:49pm UTC](https://forum.syncthing.net/t/send-and-delete/16272/1 "2021-01-30T13:49:09Z")

</div>

I miss a “Send and Delete” synchronization, i.e. it sends files from a selected folder on the phone to another device, and then deletes these files from the phone

---

<div class="post-metadata">

### Author: ![calmh](https://forum.syncthing.net/user_avatar/forum.syncthing.net/calmh/32/15311_2.png) [@calmh](https://forum.syncthing.net/u/calmh)
#### Post date: [January 30, 2021, 2:03pm UTC](https://forum.syncthing.net/t/send-and-delete/16272/2 "2021-01-30T14:03:11Z")

</div>

This is not a mode that Syncthing has, nor will have.

---

<div class="post-metadata">

### Author: ![paucku](https://forum.syncthing.net/user_avatar/forum.syncthing.net/paucku/32/12369_2.png) [@paucku](https://forum.syncthing.net/u/paucku)
#### Post date: [July 8, 2022, 9:49pm UTC](https://forum.syncthing.net/t/send-and-delete/16272/3 "2022-07-08T21:49:49Z")

</div>

> This is not a mode that Syncthing has, nor will have.

I’п sorry for reviving this thread after an year. _ **But I need to know why such mode is against the philosophy of Synchthing?** _

I too would be very happy to have the “Send and Delete” type of folders.

I tried “Send Only” but it has some side effects:

1. I don’t know when it is safe to delete the original files.
2. When I delete the files from the “receiver” folder (or move the files outside this folder on the receiver device, after a while Syncthing suggest me to sync the same files _again_. This way I start to have two versions of the same file which I don’t feel as a good way to organize files.

Now I work with “Send and Receive” type of folders to achieve the “Send and Delete” effect. It works but the problem is when I need to move files from multiple locations to one central location. Like to move all the pictires and videos from two or three phones to one computer where they to be organized and edited. Here the problem is that the phones sync between all the phones not only to the computer. This:

1. slows the synchronization down.
2. is not optimized use of resources - a file is sinced to many locations only to be deleted after it is moved away from the folder in the central location.

Would you please tell me why the mode “Send and Delete” cannot be done for Synchtnig?

---

<div class="post-metadata">

### Author: ![tomasz86](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/t/96bed5/32.png) [@tomasz86](https://forum.syncthing.net/u/tomasz86)
#### Post date: [July 8, 2022, 10:59pm UTC](https://forum.syncthing.net/t/send-and-delete/16272/4 "2022-07-08T22:59:46Z")

</div>

> [@paucku](#):
>
> Now I work with “Send and Receive” type of folders to achieve the “Send and Delete” effect. It works but the problem is when I need to move files from multiple locations to one central location. Like to move all the pictires and videos from two or three phones to one computer where they to be organized and edited. Here the problem is that the phones sync between all the phones not only to the computer. This:
> 
> 1. slows the synchronization down.
> 2. is not optimized use of resources - a file is sinced to many locations only to be deleted after it is moved away from the folder in the central location.

Wouldn’t it be better to have individual folders per phone? This way, the files wouldn’t be synced between the phones, but only between each phone and the server. Alternatively, you could set the folder on the phones to Send Only, and on the server to Receive Only. This would make each phone upload its files to the server only. Of course, you would still need to check the files on the server whether the upload has finished (manually or perhaps using some kind of an automated script), but at least the resource waste problem would be solved.

---

<div class="post-metadata">

### Author: ![calmh](https://forum.syncthing.net/user_avatar/forum.syncthing.net/calmh/32/15311_2.png) [@calmh](https://forum.syncthing.net/u/calmh)
#### Post date: [July 9, 2022, 6:09am UTC](https://forum.syncthing.net/t/send-and-delete/16272/5 "2022-07-09T06:09:56Z")

</div>

> [@paucku](#):
>
> please tell me why the mode “Send and Delete” cannot be done

I’m sure it could, but it’s not a form of file synchronization, really. Also, it’s error-prone (imagine two devices mutually configured like this) and gets complicated with more than two devices involved.

---

<div class="post-metadata">

### Author: ![AudriusButkevicius](https://forum.syncthing.net/user_avatar/forum.syncthing.net/audriusbutkevicius/32/277_2.png) [@AudriusButkevicius](https://forum.syncthing.net/u/AudriusButkevicius)
#### Post date: [July 9, 2022, 8:58am UTC](https://forum.syncthing.net/t/send-and-delete/16272/6 "2022-07-09T08:58:45Z")

</div>

> [@paucku](#):
>
> But I need to know why such mode is against the philosophy of Synchthing?

Because it’s not syncing at this point.

It’s just glorified rsync, which there is no reason to reimplement.

---

<div class="post-metadata">

### Author: ![paucku](https://forum.syncthing.net/user_avatar/forum.syncthing.net/paucku/32/12369_2.png) [@paucku](https://forum.syncthing.net/u/paucku)
#### Post date: [July 11, 2022, 4:55am UTC](https://forum.syncthing.net/t/send-and-delete/16272/7 "2022-07-11T04:55:55Z")

</div>

> Wouldn’t it be better to have individual folders per phone?

Now I have individual folders per device. Every device has a folder named “inbox DEVICE-NAME”. For example my Mac has “inbox Mac” folder, my son’s computer has “inbox Ivan” folder. My phone has “inbox P30 Lite” folder.

These folders are spread on every other devices so if I want to send files to my Mac, the only thing to do is to put the fiiles in “inbox Mac” on any of the devices.

This make it simple for me. I have only 5 folders which are _the same_ on all devices. I achieved this sameness with using the same ID for the folders in Syncthing. My “inbox Mac” folder ID is “inboxmac”, my “inbox P30 Lite” ID is “inboxp30lite”.

I tried folder types “Send only”. But there was a side effect where when I move files outside of the destination folder, Syncthing suggest me to resync that files. I did this resync several times before I realize that this way it duplicates my files. I don’t like to have multiple versions of the same files. Maybe I have renamed the first ones, may edited them, or just deleted.

I hate to have duplicate files that’s why I search for “move” option instead of “sync”.

---

<div class="post-metadata">

### Author: ![AudriusButkevicius](https://forum.syncthing.net/user_avatar/forum.syncthing.net/audriusbutkevicius/32/277_2.png) [@AudriusButkevicius](https://forum.syncthing.net/u/AudriusButkevicius)
#### Post date: [July 11, 2022, 12:32pm UTC](https://forum.syncthing.net/t/send-and-delete/16272/8 "2022-07-11T12:32:06Z")

</div>

Right, and syncthings name is syncthing for that reason.

Too many people try to use it as some sort of continuous rsync.

It’s not that, stop trying to use it as that. It won’t work.

---

<div class="post-metadata">

### Author: ![Arneko](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/a/57b2e6/32.png) [@Arneko](https://forum.syncthing.net/u/Arneko)
#### Post date: [July 14, 2022, 3:05am UTC](https://forum.syncthing.net/t/send-and-delete/16272/9 "2022-07-14T03:05:38Z")

</div>

If you find no other tool for this, I feel like you could (ab)use the “Trash Can Versioning” in syncthing.

Deletion on the originating device would need to be done manually after making sure the file is on the target device.

If you want to have more than one target device, I guess you could somehow share the trashcan folder itself…

Also, the solution people seem to envision here could easily be done if someone were to implement some form of this suggestion:

> [@Trigger script on event](https://forum.syncthing.net/t/trigger-script-on-event/13275):
>
> Hi, couldnt find anything regarding this - but could there be a feature to trigger a script on an event? F.ex. like when a new file is added to transfer queue, or when a file transfer is complete. For my part, i would like to send, with some info regarding the file in a notification on f.ex. mqtt/mail/something when a new file is in the queue and when its complete. /Chris

Which is a far more general approach and is more likely to get support from from the main devs, and indeed has been discussed on github

> <https://github.com/syncthing/syncthing/issues/5601>
>
> Configurable commands or scripts to run at various point in a file life cycle.
> …
> First: \*\*You did a great job! Thanks a lot!\*\*
> 
> \# Feature-Request: Pre and Post commands What does it means?
> 
> !\[Layout\_syncthing\](https://user-images.githubusercontent.com/9293951/54473498-deeb9580-47d8-11e9-8de5-0c46d8812cd2.png)
> 
> 
> \## Why?
> \- Encrypt data
> \- Notify users
> \- check for requirements
> \- ...
> 
> \## Pull
> 
> \- Global \*\*Pre-Pull-\*\*-Command
> - Runs \_before\_ \*\*downloading\*\* the sync
> - runs for \*\*each\*\* share not overwritting it
> - label:
> - %share-path%
> - %remote-device-id%
> - %local-device-id%
> - ...
> 
> \- Share \*\*Pre-Pull-\*\*-Command
> - Runs \_before\_ \*\*downloading\*\* the sync
> - \*\*only\*\* a single share
> - label like Global
> 
> \- Global \*\*Pull-File\*\*-Command
> - only at download
> - run it on each single file
> - runing on every share (if not overwritten in the share-setting)
> 
> \- Share \*\*Pull-File\*\*-Command
> - only at download
> - run it on each single file
> - runing only on a single share (overwrittes global-setting)
> 
> \- Global Post-Pull-Command
> - Runs \_after\_ \*\*downloading\*\* the sync
> - runing on every share (if not overwritten in the share-setting)
> - runs for \*\*each\*\* share not overwritting it
> - label like Global-Pre-Pull
> 
> \- Share \*\*Post-Pull-\*\*-Command
> - Runs \_after\_ \*\*downloading\*\* the sync
> - \*\*only\*\* a single share
> - label like Global-Pre-Pull
> 
> 
> \## Push
> 
> \- Global \*\*Post-Push-\*\*-Command
> - Runs \_before\_ \*\*uploading\*\* the sync
> - runs for \*\*each\*\* share not overwritting it
> - label:
> - %share-path%
> - %remote-device-id%
> - %local-device-id%
> - ...
> 
> \- Share \*\*Pre-Push-\*\*-Command
> - Runs before \*\*uploading\*\* the sync
> - \*\*only\*\* a single share
> - label like Global
> 
> \- Global / Share \*\*Push-File\*\*-Command
> - only at upload
> - run it on each single file
> - runing on every share
> 
> \- Global Post-Push-Command
> - Runs \_after\_ \*\*uploading\*\* the sync
> - runing on every share (if not overwritten in the share-setting)
> - runs for \*\*each\*\* share not overwritting it
> - label like Global-Pre-Pull
> 
> \- Share \*\*Post-Push-\*\*-Command
> - Runs \_after\_ \*\*uploading\*\* the sync
> - \*\*only\*\* a single share
> - label like Global-Pre-Pull
> 
> 
> 
> \## By default show global setting in share tab
> \- if values is changed, take the changed value and copy all others
> - important, as you do not know, whats is happening in the single shares if changing global settings
> - global setting can also used by set the value to \`\<global\>\`
> - setting a value to "\` \`" (empty string) means to do nothing! Do not use global setting!
> 
> 
> \## For all:
> 
> \- some labels like "%filename%", "%input-file%" = input file, %output-file% = ouput file name, "%hash%", %size%" = file size input file, ...
> - For using as \`myScriptDoingThinks --filname "%filename%" --hash %hash% --size %size% --ouput %output-file%\`
> - the client will replace all "%...%" with its values
> - if for example %output-file% is not set, file "%input-file% will be uploaded, if it is set file %output-file%
> 
> \## Labels:
> 
> \- %additional-files% = if exist, push also files in each line \`\<filename\>.sha3\\n\<filename\>.meta\`
> \- %filename% = filename no path
> \- %input-file% = filename read with absolute path
> \- %output-file% = filename write with absolute path (if not exist use %input-file%)
> \- %size% = file size input
> \- %hash% = hash of the block
> \- %device-id-local% = client id
> \- %device-id-remote% = id of extern partner(s)
> \- %email% = if support of user variables is insert so settings can take by the scripts like email
> \- %...%
> 
> 
> \## Exit codes
> 
> \- 0 = OK
> \- 1 = skip file
> \- 2 = about sync
> 
> \## Samples
> 
> \### Samples for \*\*Pre-Pull\*\*-Commands
> \- Mounting a device
> \- Checking for internet connection
> \- Checking for free space / existing file / ...
> \- Stopping a service using the shared files
> \- connect to vpn
> 
> \### Samples for \*\*Pull-File\*\*-Command
> \- Decrypt file
> \- check checksum of file
> \- unzip archivs
> \- unzip file
> \- run virus scan
> \- add data to a database, log, ...
> 
> \### Samples for \*\*Post-Pull\*\*-Commands
> \- check checksum of all file
> \- run virus scan
> \- send a notification to the user (popup)
> \- send a email notification
> \- disconnect from vpn
> \- run a deploy (e.g. copy to /var/www)
> \- run a backup
> 
> 
> \### Samples for \*\*Pre-Push\*\*-Commands
> \- generate checksum of all file
> \- Checking for internet connection
> \- connect to vpn
> 
> \### Samples for \*\*Pull-Push\*\*-Command
> \- Ecrypt file
> \- generate checksum of file
> \- zip file
> \- add data to a database, log, ...
> 
> \### Samples for \*\*Post-Push\*\*-Commands
> \- Unmounting a device
> \- disconnect to vpn
> \- Starting a service again using the shared files
> \- send a notification to the user (popup)
> \- send a email notification
> 
> \## Modifikation or addition version of \*\*File\*\*-Command
> - using pipes!
> - files is read by the client, gets piped to the command (Standard-Inputstream), doing things on the stream (read, modify, add) and outputs a pipe (Standard-Outputstream)
> \- Warning: input size may not equal output size (adding cipher header, ...)
> \- Example (Push):
> - \`encrypt-then-hash --hash %hash% --size %size% --device-id %device-id% -file-list %additional-files%\`
> 1. Opens file stream to local source file
> 2. Script
> 1. Compares stream matching %hash%
> 2. Encrypts stream and signing it with cert of %device-id%
> 3. Generate a sha3-hash of the stream
> 4. output stream
> 3. pipe stream data to extern partners
> 
> \## Final
> 
> Many information, some complexity but would to a design, where you can do crazy things.

---

<div class="post-metadata">

### Author: ![OCRenkist](https://forum.syncthing.net/user_avatar/forum.syncthing.net/ocrenkist/32/11503_2.png) [@OCRenkist](https://forum.syncthing.net/u/OCRenkist)
#### Post date: [July 17, 2022, 12:10am UTC](https://forum.syncthing.net/t/send-and-delete/16272/10 "2022-07-17T00:10:33Z")

</div>

> [@AudriusButkevicius](#):
>
> Too many people try to use it as some sort of continuous rsync.

That might be because so many people are unaware `rsync` exists, or how to use it. Even though `rsync` is pretty much included with any common `Linux` distrution, it doesn’t exactly come bundled with a handy `Bootstrap` web GUI the way `Syncthing` does — that makes a big difference for the learning curve.

> [@AudriusButkevicius](#):
>
> It’s just glorified rsync, which there is no reason to reimplement.

Yeah even me, I’m not aware of `rsync` having that functionality — the ability to delete files at the source, after confirming the checksums at the destnation?

---

<div class="post-metadata">

### Author: ![GenerallyClumsy](https://forum.syncthing.net/user_avatar/forum.syncthing.net/generallyclumsy/32/13649_2.png) [@GenerallyClumsy](https://forum.syncthing.net/u/GenerallyClumsy)
#### Post date: [January 14, 2023, 7:25am UTC](https://forum.syncthing.net/t/send-and-delete/16272/11 "2023-01-14T07:25:12Z")

</div>

I hate to revive this topic but as an outsider, I feel that this feature would be useful. I have a heap of dumb cameras gathering footage. They don’t have a lot of storage and are in an insecure location. They are not valuable but I’d rather minimise the amount of footage contained in them. Does rsync work over unreliable networks? Does rsync have a nice web GUI? Is rsync set and forget? Is rsync intrinsically secure?

---

<div class="post-metadata">

### Author: ![AudriusButkevicius](https://forum.syncthing.net/user_avatar/forum.syncthing.net/audriusbutkevicius/32/277_2.png) [@AudriusButkevicius](https://forum.syncthing.net/u/AudriusButkevicius)
#### Post date: [January 15, 2023, 11:21am UTC](https://forum.syncthing.net/t/send-and-delete/16272/12 "2023-01-15T11:21:06Z")

</div>

You can turn that question around and ask the other things that it doesn’t have about syncthing.

Rsync and ssh tunneling in general is considered secure.

Rsync on a cron is a set and forget.

The ui would be useless as it’s not longer syncing stuff, so completion percentages etc would make no sense, making the use of ui questionable.

There are various tunneling software that can help you with connectivity issues etc.

---

<div class="post-metadata">

### Author: ![IS27-Particle](https://forum.syncthing.net/user_avatar/forum.syncthing.net/is27-particle/32/15616_2.png) [@IS27-Particle](https://forum.syncthing.net/u/IS27-Particle)
#### Post date: [December 11, 2023, 4:35am UTC](https://forum.syncthing.net/t/send-and-delete/16272/13 "2023-12-11T04:35:24Z")

</div>

A better way of describing this feature request, I feel, is Blind Send. Would it be a duplicate of rsync functionality? Sure, but that doesn’t mean I couldn’t be useful as a feature in syncthing.

Imagine a multi-node environment in a share for a cloud repository is DR synced with a secondary cloud environment via syncthing. This same share is also used to sync segments of the share to multiple worker machines. These worker machine have a privatized workload configuration which offload hundreds of calculations to micro nodes. The micro nodes have a very limited storage allocation, are temporary and therefore are not capable of storing multiple iterations of its own operation. Each operation creates a folder and plethora of data files.

The use case here would be to have a single syncthing share on Master Node. Each DR Node is configured Send/Receive to enable seamless restoration. Each Worker Node is provisioned the share with a not exclude for the specific data stores. Each micro node is provisioned the same share but a not exclude for the specific node folder in this Blind Send mode. The micro node sends the data to the share and does not care about keeping the local storage. The Worker Node manages its data store rotating logs, rotating data, ingesting/sorting and configuring based on sent data. The Master Node maintains a master record of history The DR nodes maintain this same history

This is my use case, I do not want to set up an additional service to handle this functionality because it has the potential of creating disparity in the data and the micro node in this instance is an iPhone.

---

<div class="post-metadata">

### Author: ![mohamedraesa](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/m/6bbea6/32.png) [@mohamedraesa](https://forum.syncthing.net/u/mohamedraesa)
#### Post date: [January 12, 2024, 2:13am UTC](https://forum.syncthing.net/t/send-and-delete/16272/14 "2024-01-12T02:13:31Z")

</div>

I think it’ll be so handy and simple to add an option (checkmark) when synchronization set to send only (Keep remote files on deletion) or another checkmark when it is set to receive only (Don’t delete local files on remote deletion) and both checkmarks when set to send & receive

briefly two checkmarks (Send Deletions) & ( Receive Deletions)

Thanks a lot for great syncthing developers

---

<div class="post-metadata">

### Author: ![AlexPerathoner](https://forum.syncthing.net/user_avatar/forum.syncthing.net/alexperathoner/32/16893_2.png) [@AlexPerathoner](https://forum.syncthing.net/u/AlexPerathoner)
#### Post date: [July 3, 2024, 2:01am UTC](https://forum.syncthing.net/t/send-and-delete/16272/15 "2024-07-03T02:01:54Z")

</div>

I also would find this feature useful, but I can see that it’s not really synching anything at that point. Still, I like the seamless connection between devices & UI, so here’s a workaround:

1. Setup a sync between “FolderA” (on device A, where they will be deleted) and “FolderBIncoming” (on device B, where they will stay), in mode send / receive.

2. Create a crontab job that runs every 30 minutes to move files from FolderBIncoming: `crontab -e`, add a line `*/30 * * * * mv -n ~/FolderBIncoming ~/FolderB`.

This way every 30 minutes all files in the incoming folder will be moved to FolderB; syncthing will think they got deleted, and delete them in FolderA, too. If 30 minutes is not often enough (or too much), you can use crontab.guru to customise when the files should be moved.

Hope this helps someone
