Recycle Bin Samba NS8

I think it’s the best way (less work) to include all the options except the vfs objects in the global section.
For example for the recycle bin I added the following to include.conf.

To edit the include.conf enter the samba environment:

runagent -m samba1

Edit the include.conf file using nano editor:

podman unshare nano $(podman volume inspect config --format={{.Mountpoint}})/include.conf

Add following content:

[global]
recycle:exclude_dir = /tmp,/temp,/cache
recycle:repository = Recycle Bin
recycle:versions = True
recycle:keeptree = True
recycle:touch = True
recycle:directory_mode = 0770
recycle:exclude = *.tmp,*.temp,*.o,*.obj,~$*

Then you can enable the recycle bin for specific shares by defining the vfs objects for the share. This way you can test your settings on a test share without affecting all other shares.
Enabling it on all shares isn’t good as for example a backup share will grow unnecessarily because of deleted backups kept in the Recycle Bin.
The vfs objects “dfs_samba4 acl_xattr” are needed for the NethServer samba settings to work so one needs to append “recycle” to the other vfs objects instead of defining just “recycle”.

In this example the vfs objects are added to the share “testfolder”:

podman exec samba-dc net conf setparm testfolder "vfs objects" "dfs_samba4 acl_xattr recycle"

This way the global vfs objects are overridden by the vfs objects of the share.
It’s also possible to override the global recycle options like using a different name for the testfolder recycle bin:

podman exec samba-dc net conf setparm testfolder recycle:repository "Trash Bin"

Check samba registry:

podman exec samba-dc net conf list

Restart service to apply config:

systemctl --user restart samba-dc

I need to think about the Mac spotlight elasticsearch thing. I guess an elasticsearch app is needed to provide it in NS8 style. This may take some time…
The other Mac options should work.

3 Likes