vim /etc/samba/smb.conf
其中添加
#==================================
vfs object = recycle
recycle:repository = .deleted/%U
recycle:keeptree = Yes
recycle:versions = Yes
recycle:maxsixe = 0
recycle:exclude = *.tmp|*.bak
recycle:noversions = *.doc
保存退出。
systemctl enable smb.service
systemctl enable nmb.service
systemctl restart smb.service
systemctl restart nmb.service
效果:Samba中删除的文件,在samba下的/.deleted文件夹中,且保留目录结构,方便还原。