PenguinKing Posted December 20, 2024 Posted December 20, 2024 I will be having family use my server for backing stuff up and as we all know end users always end up accidently deleting things and then wanting them back. Luckily, TrueNAS has a recycle bin option and hopefully HexOS can add it in one day as a setting that can just be turned on. For anyone who finds this and wants to do it, here are the steps: Set up the folder in the HexOS UI and then in the TrueNAS UI go to: Shares > Click edit on the SMB you want to add the recycle bin too > Purpose = No Presets > Click Advanced Options > Scroll to Other Options > Check Export Recycle Bin Then you will want to set up a job to automatically empty your recycle bin: Navigate to Chron Jobs in the TrueNas UI (just search for it but it's under System > Advanced Settings). Click add then you can either enter this into the command field as ONE LINE or save it to a file find /mnt/HDDs/FOLDER/.recycle/* -atime +30 -delete; find /mnt/HDDs/FOLDER/.recycle/* -depth -type d -empty -delete; If you want to test to see what files will be deleted with this command run it without the "-delete" If you save it to a file (like I did) you will enter this as the command. sh /mnt/HDDs/PATH_TO_FILE/empty_recycle_bin.sh Then just fill out the description, run as truenas_admin, and how often you want it to run and you are good to go. Hope this helps and hopefully it can just be a 1 click type of setup in the future!! P.S. Here is what the commands do: The first command searches for files and directories in /mnt/HDDs/FOLDER/.recycle/ that have not been accessed in the last 30 days and deletes them. The second command searches for empty directories in /mnt/HDDs/FOLDER/.recycle/ and deletes them. Also commands were stolen from here 1 2 Quote
Mobius Posted December 20, 2024 Posted December 20, 2024 it didn't even occur to me that this would be a feature i would so sorely miss. thanks for the guide 1 Quote
PenguinKing Posted December 21, 2024 Author Posted December 21, 2024 Just discovered that after enabling the recycle bin I had to restart the server in order to actually get the folder to appear. So if you don't see the ".recycle" folder restart your server, hopefully that will fix it. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.