Zentyal Forum, Linux Small Business Server
Zentyal Server => Installation and Upgrades => Topic started by: francesco_r on December 15, 2008, 03:06:58 pm
-
This little guide explain how to add an hidden .recycle folder in top of each samba share.
sudo nano /usr/share/ebox/stubs/samba/smb.conf.mas
Add in each section of [home] , [<% $group->{'sharename'} %>] and [<% $share->{share} %>] after the browseable row this:
vfs object = recycle
recycle:keeptree = Yes
recycle:versions = Yes
recycle:touch = Yes
recycle:maxsize = 500000000
recycle:exclude = *.tmp|*.temp|*.o|*.obj|~$*|*.~??
Do some changes in the samba ebox module so it rewrite the smb.conf.
With the above settings the recycle bin will not save the files above 500MB. See the samba manual for other useful settings: http://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/VFS.html#id2644353
Add a script to /etc/cron.daily to delete the files after 30days of deletion:
sudo nano /etc/cron.daily/purge_samba_recycle
and write in it:
#!/bin/sh
#
find /home/samba/*/*/.recycle/* -atime 30 | xargs rm -rf
Make the script executable
sudo chmod +x /etc/cron.daily/purge_samba_recycle
Francesco
PS: remember to rewrite these mods if you update the samba ebox module
-
There is an error in the script
/etc/cron.daily/purge_samba_recycle
"xargs -rf" don't delete file names with space. So modify to:
#!/bin/sh
#
find /home/*/*/.recycle/* -atime 30 -exec rm {} \;
It's slower but works.
-
There is an error in the script...
You're right - thanks for the post!
I found the error yesterday, too - but I have searched a while... ;-)
Another thing: it seems, that my configuration ignores the "recycle:maxsize" parameter (also files over the specified size are copied into the .recycle folder).
Do you have any suggestions to that?
-
Hi,
Does the Ebox 1.0 support this?
TIA
-
I'm afraid to tell you that it is not. :(
Best regards,