Recycle Bin Samba NS8

how do you enable network recycle bin in samba? And how do change the install domain in NS8?

To add a recycle bin, we need to enter the samba dc container, in this example samba1 is the app instance name:

runagent -m samba1 podman exec -ti samba-dc bash

Add the recycle bin config (same as on NS7) to the include.conf file that takes custom configurations. Be careful that following command adds some lines to the file so just do it once:

echo "  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,~$*" > /etc/samba/include.conf

Exit the container:


Restart the service:

runagent -m samba1 systemctl --user restart samba-dc

Good morning Markus!

It isn’t written in the docs, but it’s worth noting that the code uses also the samba registry as per-share config backend. Changes to the registry are picked up from the next share connection, and don’t require service restarts.

See for example the API that set the share description: ns8-samba/imageroot/actions/alter-share/50alter_share at main · NethServer/ns8-samba · GitHub

Refer also to net conf setparm manpage.


That’s nice and it works: (in this example testfolder gets a recycle bin)

net conf setparm testfolder recycle:exclude_dir /tmp,/temp,/cache
net conf setparm testfolder recycle:repository "Recycle Bin"
net conf setparm testfolder recycle:versions True
net conf setparm testfolder recycle:keeptree True
net conf setparm testfolder recycle:touch True
net conf setparm testfolder recycle:directory_mode 0770
net conf setparm testfolder recycle:exclude *.tmp,*.temp,*.o,*.obj,~$

But the service needs to be restarted to apply the config.