Hello, all. What mechanism does samba use to delete a file on a *nix box when deleted from a connected Win2k machine? In other words, does it run the rm -f command? Some other command? Who does it run as? Can I intercept the command and insert my own script? I'm interested in creating an undelete shell script that keeps files from "accidentally-on-purpose" being erased from the fileserver. Thanks in advance, /====================================================\ | Michael Luevane * Network Administrator | | Quantec, LLC * 503-228-2992 | | mikel@quantecllc.com * http://www.quantecllc.com | \====================================================/
On Tue, 22 Oct 2002, Michael Luevane wrote:> Hello, all. > > What mechanism does samba use to delete a file on a *nix box when deleted > from a connected Win2k machine? > > In other words, does it run the rm -f command? Some other command? Who does > it run as? Can I intercept the command and insert my own script?It unlinks the file, but you can use a loadable VFS module to change the way that low level file system calls get handled.> I'm interested in creating an undelete shell script that keeps files from > "accidentally-on-purpose" being erased from the fileserver.Have you checked the samba source code. Samba-2.2.6 has a recycle bin facility that might fit your needs. The samba-team binary and source RPM packages for Caldera OpenLinux, SuSE Linux, Red Hat Linux and Mandrake Linux all include ready to run loadable VFS modules for this recycle bin functionality. If you need more info please ask. - John T. -- John H Terpstra Email: jht@samba.org
Hello, i am trying to do this, too - to set up the recycle bin to work with W2k connected machines to my samba server. I put both lines to the smb.conf ( vfs object and vfs options ), but it still doesn't work. When I delete some file on W2k client, it's lost forever. Should I create the directory specified in th recycle.conf ( name = .recycle) or make some additional settings ? Thanks a lot.. My recycle.conf follows: name = .recycle mode = KEEP_DIRECTORIES|VERSIONS|TOUCH maxsize = 0 exclude = *.tmp|*.temp|*.o|*.obj|~$* excludedir = /tmp|/temp|/cache noversions = *.doc|*.xls|*.ppt Ondrej Foukal