People are stupid and remove things accidentally. You can partly mitigate that by adding recycle bin functionality to a samba share.
[Our documents] comment = Central storage for all our documents path = /home/smb guest ok = yes writeable = yes browseable = yes force group = samba create mask = 0660 directory mask = 0770 ; recycler vfs object = recycle:recycle recycle:subdir_mode = 0770 recycle:repository = .recycle ; directory name recycle:keeptree = Yes recycle:touch = Yes recycle:versions = No recycle:maxsize = 100000000 ; 100 metric million bytes
The action is hooked on the delete action. Pressing shift-delete won’t prevent files from being moved to the recycler, which is good.
You can then make a cron job which throws away old files:
# Every day at 6am 0 6 * * * root find /home/smb/.recycle/ f -mtime +5 -delete > /dev/null
Recent Comments