SMB share recycle bin options

andresuporte

Cadet
Joined
Oct 16, 2023
Messages
8
Here we go again.
When I used SMB sharing on Linux servers for the Windows environment, I used to indicate a folder as the recycle bin where all the contents of all shared folders went there only. Obviously, I did not share this folder, which was never visible on the network, and each collaborator who deleted a file would have to contact us, thus maintaining control.

In Truenas Scale, when checking the "export recycle bin" option, the .recycle folder is hidden in each mapped directory, but is easily accessible by the user (who has already done the favor of deleting the file hehe) and still generates greater complexity in search time

I intend to test the steps I used in the Debian days to create a unified recycle bin, but I would like to know if there is natively an option to indicate the location of the recycle bin, the ACL parameters (as well as any other folder) and the restoration options (versioning ).

Truenas Lixeira.png
 

andresuporte

Cadet
Joined
Oct 16, 2023
Messages
8
Much worse than I thought

The smb4.conf file is not directly editable. All changes are overwritten the moment I restart the SMB service
I saw that you need to add the parameters through the GUI in the "services" > "SMB" > "Auxiliary parameters" options
Unfortunately for me, TrueNAS disabled this option in the last few updates ("security" issues)
Some posts say it is possible to add these parameters via "TrueNAS CLI". I tried. (Note: I've never seen such a limited shell)

I would try adding the following parameters in the global options

vfs objects = recycle
recycle:keeptree = yes
recycle:versions = yes
recycle:repository = /etc/samba/recycle
recycle:exclude = *.~*, ~*.*, *.bak, *.old, *.iso, *.tmp
recycle:exclude_dir = temp, cache, tmp


Any idea?
 

andresuporte

Cadet
Joined
Oct 16, 2023
Messages
8
Another thing

I did other tests with the standard recycle bin. As I mentioned, the "hidden" .recycle folder is at the mercy of the user's willingness not to mess up.
I deleted a test file and it went to the trash, great. I deleted the .recycle folder (easily, by the way) in Windows. Then the folder and file go into limbo. To return to the folder I must uncheck and re-check the "export recycle bin" field. This returns the folder, but the deleted file is gone
To avoid this, I need to set parameters in each folder denying the user's rights to delete the recycle bin.

This cannot be the default way for SMB to work on TrueNAS.
 
Top