Enable Recycle Bin in Samba 4


I have SAMBA 4 server installed on OpenWrt and I would like to enable the recycle bin feature. There are quite a few configuration files for Samba such as

  • /etc/samba/smb.conf
  • /etc/samba/smb.conf.template
  • /etc/config/samba4

so I am unsure where I should be applying the following configuration:-

	vfs objects 'recycle'
	recycle:repository '.recycle'
	recycle:keeptree 'yes'
	recycle:versions 'yes'

When I add the lines above to the /etc/config/samba file, it breaks the configuration when I try to view it via the LuCI app.

These are the SAMBA parameters I'm going by https://www.samba.org/samba/docs/current/man-html/vfs_recycle.8.html

Can anyone suggest where I'm going wrong here please?

Many thanks


Sorry for the late answer, but the easiest method would be to just add recycle to the luci Vfs objects field. This will use the default settings and needs no extra setup.

The problem is that we don't have support for all the vfs modules extra parameters. So if you want to run none default values for a vfs module you can either try add them to the global's section in /etc/samba/smb.conf.template or you have to remove your share from the uci/config and directly add it to the smb.conf.template where you can than also add all the vfs special options.
You can check what to add in the template if you check the "live" /tmp/etc/smb.conf just copy&paste your share from the end of this file to the template and add the VFS stuff.

1 Like