Trash should be default remove behavior

Removing valuable data from 1 machine cascades and removes all the data on synced machines. Keeping Trash the default behavior would save a lot of headaches and time (like I lost tonight) for the newcomers.

Having only 1 recent copy shouldn’t add much drag on the filesystem, and is super useful on accidental destructive operations.

1 Like

I agree with you. I didn’t always, but I do nowadays. I’d like to propose that we:

  • Enable the “Trashcan” strategy as the new default versioning scheme, instead of the current “none”.
  • Modify the Trashcan scheme to use the system “recycle bin” (or whatever they are called) on OS X and Windows.

Linux behavior can remain as is in the absence of another recommended way to do it.

I suspect this may require some cgo/syscall magic on the platforms in question.

4 Likes

I’d also like to rename everything related to “Versioning” to “Archiving” instead, but that’s something else. :wink:

Thanks for the quick reply and considering addressing this! Sounds good to me.

Probably a bit unrelated - personally I use trash (trash-cli in aptitude) both on OSX and Linux aliased to rm. Of course this was a new box and I didn’t have the alias set. Just writing this in case you might want to take a look if it’s easy to implement on Linux as well. I’d prefer to have the same behavior across OS-es, but it’s not that important.

Trash-cli isn’t installed by default on most linux distros and its behaviour changes between versions.

While I like the idea for this use I don’t think ST can support it by default.

Perhaps it could be the example for custom versioning in the docs though.

We have a custom versioning system already, where someone can write a little script which teaches Syncthing how to use trash-cli, or whatever their Linux trashcan of choice is.

Maybe we could add some examples of scripts for common linux (or other third-party) trashcans to the docs, but I think the case of using third-party trashcans on linux is well covered.

1 Like

Where “this case” refers to trashcans on Linux right? I think we’re pretty lacking in handling this on OSes that do have a default trashcan system.

Yep, exactly (edited for clarity).

I’m not expecting someone to magic together a batch script that deletes stuff to the recycle bin on Windows :smiley:

Neither dropbox nor any other tool that does the same job provides this (atleast locally as far as I am aware) and I would be very much against a tool like this keeping some garbage files it thinks are important without me asking it to do so.

I am definately against you duplicating or keeping around my 500GB VM images just because a user managed to shoot himself in the foot.

It’s the users fault, and the user needs to set up some other solution (or just enable versioning) if he cares about it.

Dropbox also automatically saves deleted files for 30 days.

I hope not locally though.

Dropbox isn’t comparable as it has a server to keep things on. I think it’s come up a few times that the expectation is that deleted files end up in the Trash on systems that have a Trash.

In trash fine, but not in some random hidden directory please.

This whole discussion is about putting them in the system trash.

The OP does not mention that, and first post by @calmh mentions enabling trashcan by default, which is what I am rebelling against.

Ah right, so @calmh suggested always enabling Trashcan versioning by default, and making it use the system Recycle Bin on OSX and Windows. You’re suggesting making it use the system Recycle Bin, and only enabling trashcan versioning by default on OSX and Windows?

So I am fine to enable by default everywhere, as long as deleted files go to some reasonable known place, rather than some hidden directory only the chosen few know of.

Most of Linux window managers provide trashcan functionality as well, yet it’s window manager specific.

A good example for this is send2trash python library, yet it seems you need cgo to do it properly on OS X. Perhaps there is a built in CLI tool to do that.

The usecase for 500GB VMS is pretty specific IMO, and different than the majority of standard users.

We’re talking about a default value here; There should be an opt-out option for this, the same way it’s opt-in today.

The biggest problem is that these options are not synced, and it’s easy to leave out one machine accidentally misconfigured.

I think that’s OK: the files will still be present on the other machines in the cluster

So I think it would be reasonable to enable trashcan archiving by default on Windows and OS X, and use the system trashcan there. On Linux (*BSD, Solaris, etc) there is no concept of a system trashcan and the general expectation is probably closer to “delete a file and it’s gone”. I would be fine with not changing the default there.