#recycle:repository = /samba/deleted/public/%U #指定該共享文件夾的回收站目錄 %U是按登錄的用戶名分開存放
recycle:repository = /samba/deleted/public
recycle:keeptree = Yes #指定是否按刪除時的目錄結構存放
recycle:versions = Yes #指定是否區覆蓋同名的文件,yes是不覆蓋
recycle:maxsixe = 0 #指定回收站目錄的大小,0是不限制
recycle:exclude = *.tmp|*.mp3 #不放入回收站的文件類型
recycle:noversions = *.doc #指定覆蓋同名文件的文件類型
[公用文件夾]
comment = 公用文件夾
path = /samba/public#共享文件夾路徑
read only = no#共享文件夾是否是只讀
valid users = @kfb,root #用@指定可訪問的用戶組,不同組和用戶之前用","分開
#指定用戶建立文件或目錄時的默認權限
create mask = 0660
directory mode = 2770 force create mode = 0660 force directory mode = 2770
#禁止上傳的文件
veto files = /*.mp3/*.mp4/*.rmvb/*.wma/*.exe/*.bat/*.dll/*.avi/*.rar
#回收站設置
vfs object = recycle
recycle:repository = /samba/deleted/public
recycle:keeptree = Yes
recycle:versions = Yes
recycle:maxsixe = 0
recycle:exclude = *.tmp|*.mp3
recycle:noversions = *.doc
vim /etc/crontab
30 8 * * * root find /samba/deleted/ -mtime +30 -exec rm -rf {} \;
上面的設置就是每天8:30 刪除回收站內大於30天的文件 3.每個共享文件夾要單獨設置一個回收站文件, 避免同名文件覆蓋,同時也方便管理和查找.