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