Did you know  45Drives offers free  public and private  webinars ? Click here to learn more  & register! Build & Price

KB450291 – Adding Recycle Bin to SMB Shares with Houston UI

You are here:

Scope/Description

  • In this article we’ll go over the steps to add a Recycle Bin for deleted files/folders through Houston UI

Prerequisites

  • Houston UI
  • SMB share

Steps

  • Go to the “File Sharing” tab to edit the samba share you wish to add a recycle bin to.

  • Once we’re in the Configure Samba Share menu, we add these options to the “Advanced Settings” then click apply.
vfs objects = recycle
recycle:repository = .recycle
recycle:keeptree = yes
recycle:versions = yes

  • Next, we have to add a cron task to automatically delete files from the recycle folder, otherwise we can’t actually free any space on the server. We do this first by entering:
root@ubuntu-45drives-bailey:~# crontab -e
  • Next, we add the command that will automatically delete any items older than 7 days:
0 0 * * *       find /tank/*/.recycle/* -atime +7 -delete

Note that the path is setup as “/pool/sharelocation/recyclefolder/recyclefoldercontents”

  • Then we can save the cronfile, and verify with:
root@ubuntu-45d:~# crontab -l

  • Finally, we have to restart the SMB service. We do this with in the terminal with the commands below, make sure to use the command for the OS you are running:
root@ubuntu-45d:~# systemctl restart smbd
[root@rhel-flavour-45d ~]# systemctl restart smb

Verification

  • If we’re to go onto our SMB share, and delete a folder with contents/a file, we can then navigate to the hidden recycle folder to see that it got moved over to there, instead of deleted entirely:

Troubleshooting

  • If the folder does not show up in the recycling bin, ensure that the SMB service was restarted
  • If you simply delete an empty folder, it will not get moved into the recycling bin, there must be subfolders and/or files within the folder
Was this article helpful?
Dislike 0
Views: 220
Unboxing Racking Storage Drives Cable Setup Power UPS Sizing Remote Access