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

Having issues with your DietPi installation or found a bug? Post it here.
Post Reply
LeVraiRoiDHyrule
Posts: 55
Joined: Tue Apr 28, 2020 3:00 pm

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

Post by LeVraiRoiDHyrule »

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.
User avatar
Joulinar
Posts: 4823
Joined: Sat Nov 16, 2019 12:49 am

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

Post by Joulinar »

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/question ... mba-shares

Maybe you can give it a try
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
LeVraiRoiDHyrule
Posts: 55
Joined: Tue Apr 28, 2020 3:00 pm

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

Post by LeVraiRoiDHyrule »

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 :

Code: Select all

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/knowl ... -in-samba/
And added this to my samba share :

Code: Select all

        # 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
User avatar
Joulinar
Posts: 4823
Joined: Sat Nov 16, 2019 12:49 am

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

Post by Joulinar »

honestly I never used such a functionality. I just did a google search on the web
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
User avatar
trendy
Posts: 314
Joined: Tue Feb 25, 2020 2:54 pm

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

Post by trendy »

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/question ... xtundelete
Post Reply