Recycle Bin (vfs recycle) for SMB Shares


dlandon

Recommended Posts

There are two tasks that run on a cron, one calculates the trash size, and the other does the remove of aged files depending on your settings.  The last time the recycle bin ran to remove aged files was on April 15th.  Try the following:

  • Restart the recycle bin.
  • Reboot if that doesn't work.
  • Thanks 1
Link to comment
  • dlandon changed the title to Recycle Bin (vfs recycle) for SMB Shares
  • 4 weeks later...
  • 3 weeks later...

Ive been using this plugin for a while now without fail, but I just noticed it does not recycle files deleted by Radarr/Sonarr.  So if I go into my movies folder and delete a file, it keeps a copy in the .trash folder under the host name of the computer that deleted it so the plugin works perfectly.  But if Radarr deletes a file (Like say when doing a movie upgrade from 720p to 1080p), it deletes that 720p file but it doesnt goto the recycle bin.  It's just gone.  Anyway to have the plugin save those files too?  Sometimes radarr does an upgrade and the higher resolution version may have something wrong with it, or be worse than the file before and now my original file is gone forever.  Radarr is running in a docker on the unraid machine.

Edited by 007craft
Link to comment
1 hour ago, 007craft said:

Ive been using this plugin for a while now without fail, but I just noticed it does not recycle files deleted by Radarr/Sonarr.  So if I go into my movies folder and delete a file, it keeps a copy in the .trash folder under the host name of the computer that deleted it so the plugin works perfectly.  But if Radarr deletes a file (Like say when doing a movie upgrade from 720p to 1080p), it deletes that 720p file but it doesnt goto the recycle bin.  It's just gone.  Anyway to have the plugin save those files too?  Sometimes radarr does an upgrade and the higher resolution version may have something wrong with it, or be worse than the file before and now my original file is gone forever.  Radarr is running in a docker on the unraid machine.

 

43 minutes ago, jonathanm said:

No, The plugin can only intercept actions done over SMB.

Actually, you can. It's not really the intended use of the plugin but it works.

 

You'll need to create a new path in the docker to your recycle _bin. Example-

1837148819_ScreenShot2021-06-25at9_31_51PM.png.4ef08a780e0a8017a6cc877f3477090c.png

 

And you'll also need to add a script to create a file in the recycle bin so it doesn't go away when emptied.

 

Discussion of this starts here and continues for a page or so. It's been quite a while since I set this up but I'll try to answer any questions if you have any after reading.

Link to comment
2 hours ago, wgstarks said:

 

Actually, you can. It's not really the intended use of the plugin but it works.

 

You'll need to create a new path in the docker to your recycle _bin. Example-

1837148819_ScreenShot2021-06-25at9_31_51PM.png.4ef08a780e0a8017a6cc877f3477090c.png

 

And you'll also need to add a script to create a file in the recycle bin so it doesn't go away when emptied.

 

Discussion of this starts here and continues for a page or so. It's been quite a while since I set this up but I'll try to answer any questions if you have any after reading.


Thanks, but that discussion got complicated for me.  I couldnt really follow what the problem was.  Perhaps tho it has to do with an old version of radarr because I just checked the settings in radarr now and theres a "recycle bin" option to input a folder and then after 7 days (or however many days you set) it will delete the files.  I guess ill just use that.  No need for this plugin at all I guess since its built into radarr.

Link to comment

Hi, I have same problem as Arby mentioned before - RecycleBin was installed properly but does not work for me... No .recycle.bin folders created, nothing is happening after deleting the files.. Please see screenshots below:

 

I have created and then deleted the file test.txt, but have not seen any recycle.bin folder created afterwards:

image.thumb.png.53f3a452928914964212e1fff38a4a59.png

 

image.png.db2e2debd8a383d0c4cd6effcfe2096d.png

 

image.png.7e3493cc86eef4434aa0537a0a393eac.png

 

Please see my configurations below:

image.thumb.png.0c160721e381a3d7087a36e60835c207.png

 

There is some RecycleBin folder exists in /mnt,

image.png.ed3c76258c247431ff59a4cbc0431118.png

 

but has no any deleted files:

image.png.f3f20f49eacb3a2344a10f32b944c023.png

 

Please kindly suggest what to do and how to resolve the issue.

Thank you very much!

nas-diagnostics-20210630-1402.zip

Edited by R1ver
Link to comment
1 hour ago, R1ver said:

Through Windows SMB, by pressing "Delete" button on \\nas\Trainings\test.txt

I would set the 'Update Recycle Bin Size in Background?' to 'Yes'.  It refreshes the trash sizes and the share folders in the background.  The log shows the deleted file, so it is working.  There can sometimes be a slight delay in deleting a file and when it shows in the trash bin and local folders.

Link to comment

Hi, I got what`s a problem is.

No matter if 'Update Recycle Bin Size in Background' set to Yes or No:

- if I create empty test.txt file and then delete it - nothing happens

- If I put some text into test.txt an then delete it - it works :)

 

So, when testing the service it is necessary to delete files with the contents, otherwise it would not work.

 

Thanks a lot for support and apologies for so dummy issue :)

Link to comment
4 minutes ago, R1ver said:

Hi, I got what`s a problem is.

No matter if 'Update Recycle Bin Size in Background' set to Yes or No:

- if I create empty test.txt file and then delete it - nothing happens

- If I put some text into test.txt an then delete it - it works :)

 

So, when testing the service it is necessary to delete files with the contents, otherwise it would not work.

 

Thanks a lot for support and apologies for so dummy issue :)

The recycle bin plugin will not recycle an empty file.  Why bother?

Link to comment
On 6/26/2021 at 10:01 PM, dlandon said:

I don't see anything wrong.  I tried and it installed for me.

 

Try this:

  • Uninstall the recycle bin plugin.
  • Delete the /flash/config/plugins/recycle.bin/ folder.
  • Re-install the recycle.bin plugin.

Yes! it works. Reall appreciate for your help. 

Link to comment
  • 1 month later...
On 6/30/2021 at 3:07 PM, dlandon said:

The recycle bin plugin will not recycle an empty file.  Why bother?

Actually this might be interesting because:
If you might have a file like "ssh" in your raspberry pi config folder which is an empty file, this file might not be recycled and if you would go to recover the recycled folder it will be recovered without the ssh file.

Thus if not noticing and if pushing this to the sd of your pi you would be unable to connect over ssh.

 

Hope im not mistaking here. Just a thought.

Link to comment
On 6/30/2021 at 2:07 PM, dlandon said:

The recycle bin plugin will not recycle an empty file.  Why bother?

 

Because the metadata of a file is itself data in the same way its contents is e.g. its name, size and creation date etc. So if the Recycle Bin is there to protect data from accidental deletion then it should protect the metadata from deletion as well.

 

Also, sometimes some content-type data is stored in the file name rather than within the file so some operations can be performed with just directory access rather than opening each file. An example is hMailServer which downloads each email into a file named <GUID>.eml. Granted the files in this case should never logically have zero size, but I have seen them with zero size when there's been a disk problem.

 

Another good example where zero length files could be significant is if a program's data or installation folder gets deleted by accident. I might have no idea whether there are zero length files in there or not or if any zero length ones have any meaning - I would just go to the Recycle Bin and recover the whole lot.

 

I would also say it is more intuitive to have all files protected - I assumed they were until I read this post!

 

By the way, I'm not criticising Recycle Bin as it stands - it's still a great addition to unRAID - I'm just answering the question by explaining why I would bother to protect empty files.

Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.