Create a Recycle Bin for Samba

by Mike on November 14, 2008

in File Server

“Whoops…I deleted the wrong file.  Can you get that back for me?”  Is that a question you are often asked as an administrator? Well if you run Samba servers that save files for Windows machines that may be a common problem.   Save your self a lot of work by providing a Recycle Bin for your users.

Here is an example of modifying the home directories of your users.

comment = Home Directory
valid users = %S
browsable = no
guest ok = no
read only = no
vfs object = recycle
recycle:repository = Recycle_Bin
recycle:keeptree = yes
recycle:exclude = *.tmp, *~, *.bak

The “vfs object” line calls in the plug-in that enables recycle bin capability.  On the other lines, you’re setting the name of the recycle bin directory, telling Samba to preserve the whole structure of any directories that a user may delete, and finally, telling it to not backup certain types of files.

Keep in mind, that the recycle bin directory isn’t created until a user actually deletes something. Once a document is deleted they will have access to retrieve, and they also feel more like they are on a Windows server.

Previous post:

Next post: