samba recycle bin

hi guys i just wanted to know if its possible and how to setup a recycle bin for the samba shared folder,for example if a samba user deletes a file on the shared folder it must go into the recycle bin instead of just getting completely deleted,thanks guys

Create a folder for trash in the share. It can have any (reasonable) name. It can be hidden or not hidden. e.g. I’ll use .rubbishbin for the name here.

Add these lines into the configuration stanza for the share in the Samba config file (smb.conf):

vfs object = recycle
recycle:repository = .rubbishbin
recycle:keeptree = yes
recycle:exclude = *.tmp, *~, *.bak


  • files defined in recycle:exclude will not make it to the rubbishbin
  • if you don’t create .rubbishbin it will autocreate when you delete stuff
  • recycle:keeptree will maintain the directory tree (relative to the shared directory)
  • the last three lines are optional

thanks swerdna,i did try it but for some reason it does not work,this is how i have done it in my smb.conf

vfs objects = recycle
recycle:keeptree = True
recycle:versions = True
recycle:touch = False
recycle:maxsize = 0
recycle:repository = .recycle/%u

Can’t help much here. Try no and yes instead of true/false. And I don’t know the option “version” (but then I have only used this in the form I showed here). And I find the maxsize ambiguous; to me it means the opposite of what it means to you; to me it means that if 0 then delete everything exceptn files with 0 bytes. If you mean – keep everything, the man page says to make the maxsize -1, or common sense says maybe don’t mention it and everything will be backed up.

thanks swerdna,i got it to work on a share that i create of the root directory,the previous i was trying was in the home folder,it doesnt seem to work in the home folder no matter what i do,thanks again for your help