Quote:
Originally Posted by jakev383
I have need to set up a samba share where users can add/modify files all they want, but nobody will be able to delete files without a password. It'd be nice to keep a log of who deleted what and when if possible.
Worst case is setup samba to move the files a user wants to delete to a "trash bin" to be deleted by an admin later.
Has anyone setup anything similar? I currently run 2 samba shares - on one all users use the same user/pass (guest ok) where they have full access. I have another where a separate user/pass is used by all users that only a few users have access to.
All users are of course running XP Home or Pro, with no domain controller present.
Thanks in advance.
|
To answer my own post:
I set up a "recycle bin" for the network share using VFS for Samba (built in on the CentOS version, may be on others as well). I created a share called "Trash" and then created a symlink to it into the user's network share as a hidden file (.deleted). VFS takes the file when a user deletes it and moves it to the .deleted folder (which is symlinked to the recycle folder). I then access the "Trash" share as another mapped drive and can manually delete files, thus stopping the accidential deleteion of files by users. Here's my shares setup in my smb.conf:
[Home Share]
comment = Home Share
path = /rd0/home-share
writeable = yes
guest ok = yes
read only = no
public = yes
hide dot files = yes
follow symlinks = no
vfs object = recycle
recycle:repository = .deleted
recycle:keeptree = Yes
recycle:touch = Yes
recycle:versions = Yes
recycle:maxsixe = 0
recycle:exclude = *.tmp
recycle:exclude_dir = /tmp
[Network Trash]
comment = Network Trashcan
path = /rd0/recycle
valid users = trash
writeable = yes
public = no
Now my next question is how do I change the timestamp on the files when they get moved into the "Trash" folder? I'd like to whip up a cron script to delete files after 5 days or so to keep the system sane.
Thanks.