Is there a way to have like a bin or an "undo" feature with ProFTPD or Samba ?

Hi,

I use a lot my Samba server to manage my movies of my DietPi server. The problem is that I have more than 700 movies that represents up to 4tb of data. I need to be able to edit them frequently with my server so putting them read-only is not an option. On the other hand, I don’t want to risk loosing everything with a bad manipulation or a program doing what it wants.

Is there a way to have deleted files going to a bin like in Windows instead of being forever deleted ? That would help me to restore and undo if I do a mistake.

(Backuping my full disk elsewhere is not an option as I can’t afford a second 6tb disk)

I would like to be able to rename, edit or move files with my file server, but being completely unable to delete a file forever. Is that possible ?

It could work with ProFTPD or Samba, I have no preference.

Thanks in advance for any suggestion.

not sure if Debian is supporting something like this. But maybe SAMBA support such a functionality. I found an extrem old entry on the web

https://unix.stackexchange.com/questions/112063/how-can-i-have-a-trash-recycle-bin-for-my-samba-shares

Maybe you can give it a try

Hi,

Thanks for finding VFS Recycle for Samba, it looks like it is what I need.

But I didn’t succeed to make it work. If I simply add :

recycle:repository = .recycle
recycle:keeptree = yes
recycle:versions = yes

It looks like it partially work. With this configuration, a .recycle folder is successfully created.
When I delete a file from /westernhdd/Films for example, it creates folders in .recycle.
After deleting /westernhdd/Films/testfile.txt , it creates /westernhdd/Films folders inside .recycle. But the testfile.txt is not present in it.

I also tried this guide : https://www.magic4hosting.com/eng/knowledge-base/enable-vfs-and-recycle-functionality-in-samba/
And added this to my samba share :

        # Enable the recycle 
	binvfs object = recycle
 	recycle: repository = /mnt/westernhdd/recycle/%U
    	recycle: touch = Yes
 	recycle: keeptree = Yes
    	recycle: versions = Yes
    	recycle: noversions = * tmp, * temp, * o, * obj, * TMP, TEMP *......
    	recycle: exclude = * tmp, * temp, * o, * obj, * TMP, TEMP *......
    	recycle: excludedir = / recycle, / tmp, / tmp, / tmp, / TEMP

But this doesn’t work, deleted files are still really deleted.
I am probably missing something but I don’t know what

honestly I never used such a functionality. I just did a google search on the web

Usually such an option exists when you are using the desktop environment.
There isn’t anything like that for Samba and FTP to the best of my knowledge.I was wrong on Samba
In cases of accidental deletion, there is a possibility to restore a file.
https://unix.stackexchange.com/questions/122305/undelete-a-just-deleted-file-on-ext4-with-extundelete