|45 Drives Knowledge Base
||KB450121 - Enable SMB Recycle Bin in FreeNAS
Shadow copies are really useful for accessing previous versions of a working document, but what happens if the working document is accidentally deleted? That’s where the recycle bin feature of FreeNAS shares allows you to recover a document that’s been deleted by accident. However, it is not enabled by default. It should be turned on when setting up personal shares.
To enable the recycle bin on a personal share select the share in the FreeNAS WebUI and then click on Advanced Mode.
Next, check the box for Export Recycle Bin.
That’s all there is to it.
Deleted files can be recovered from .recycle a hidden folder in the share.
Possibly one of the reasons the recycle bin is not enabled by default is that there isn’t a built-in feature in FreeNAS to manage the recycle bin. To work around this, add a line similar to the following to a cron job that runs daily. It will purge all files more than seven days old from the recycle bin of personal shares.
find /mnt/primary/home/*/.recycle/* -atime +7 -delete