Recycle Bin (vfs recycle) for SMB Shares


dlandon

794 posts in this topic Last Reply

Recommended Posts

  • Replies 793
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

This is a plugin that will create a per share .Recycle.Bin folder on each smb share for files deleted on that share.  Built into samba is a module called "vfs recycle" that handles the deletion of fil

Shares were not displaying when "Log Deleted Files" was set to "No".  This has been fixed in the latest version.

No longer true.  I'm releasing a new version that will not show any remote mounted shares and the local recycle bin will not remove any files from the remote share recycle bins.  Only the local server

Posted Images

But that's the thing, it was never deleted (at least by me). Only uploaded once (last night) while I was typing to you originally asking about the changes.

 

To make it even more strange, the receipt still exists where it is supposed to, and is a 332kb file. The reference in the recycle bin is a 0kb file?

 

There are other files here in the settings page that should not exist in the recycle bin, but are there (and have the originals still existing in the array). For example, a photo I uploaded to my Photography share last week, also has a 0kb reference in the recycle bin, however the photo exists in the folder as it should (but also has this rogue 0kb copy in recycle bin).

Link to post

No. The Recycle Bin plugin is correct.

 

I see this all the time with multiple programs.

 

What they seem to do is initially create a 0 byte file with the original filename. They then write to a new temp file, then delete the place-holder file,  then rename the new temp file to the original filename.

 

This happens exactly like this when downloading .NZB or .Torrent files from WinOS clients via web browser and writing to it from SAMBA. It also happens when Emby does media scans from WinOS clients.

 

It seems to be how WinOS Clients operate when writing to network shares.

Link to post

Thanks BRit, that sounds like it would be the case. The computers we use in the house are windows computers, and the files could end up on the server via a multitude of different ways. For example, the photo I uploaded was downlaoded through an email in chrome, and when the save explorer popped up, I saved directly to my share. The receipt was also a receipt I had in my email (chrome again), and I "printed" it to *.pdf directly to the array etc etc...

 

So what you are saying is that some programs take 4 x steps to get to the final destination:

 

1. write 0kb file with to-be file name (assume to check for duplicates?)

2. delete the 0kb file

3. write the file in some cryptic .tmp format

4. move the .tmp file to the original to-be name

 

Got it...

 

Thanks guys, I feel more comfortable. Was slightly worried some of my files were ending up in the recycle bin, knowing I have not combed every file prior to purging. Was nervous I may have been losing misc files here and there.

Link to post

I just installed this plugin for the first time and I get the following error on the Settings page:

Warning: file_get_contents(/boot/config/smb-extra.conf): failed to open stream: No such file or directory in /usr/local/emhttp/plugins/dynamix/include/DefaultPageLayout.php(292) : eval()'d code on line 16

Link to post

I just installed this plugin for the first time and I get the following error on the Settings page:

Warning: file_get_contents(/boot/config/smb-extra.conf): failed to open stream: No such file or directory in /usr/local/emhttp/plugins/dynamix/include/DefaultPageLayout.php(292) : eval()'d code on line 16

 

What version of unraid?

Link to post
  • 2 weeks later...

I am getting something similar on 6.2.0-beta21

 

Warning: file_get_contents(/boot/config/smb-extra.conf): failed to open stream: No such file or directory in /usr/local/emhttp/plugins/dynamix/include/DefaultPageLayout.php(300) : eval()'d code on line 16

Link to post

I am getting something similar on 6.2.0-beta21

 

Warning: file_get_contents(/boot/config/smb-extra.conf): failed to open stream: No such file or directory in /usr/local/emhttp/plugins/dynamix/include/DefaultPageLayout.php(300) : eval()'d code on line 16

 

I'm not seeing this.

Link to post
  • 2 weeks later...

I am getting something similar on 6.2.0-beta21

 

Warning: file_get_contents(/boot/config/smb-extra.conf): failed to open stream: No such file or directory in /usr/local/emhttp/plugins/dynamix/include/DefaultPageLayout.php(300) : eval()'d code on line 16

 

I'm not seeing this.

 

Found the problem.  Fixed in the latest release.

Link to post

First of, awesome plugin!  Thanks for taking the time to create and maintain it.

 

The second question is in regards to excluding shares... what is the correct format to use, as it does not seem to be working for me.

 

I've just put in "Movies,TV" but do I need to put the full path? (Help doesn't state the format).

 

Thanks again!

 

~Spritz

Link to post

First of, awesome plugin!  Thanks for taking the time to create and maintain it.

 

The second question is in regards to excluding shares... what is the correct format to use, as it does not seem to be working for me.

 

I've just put in "Movies,TV" but do I need to put the full path? (Help doesn't state the format).

 

Thanks again!

 

~Spritz

 

Only the share names.  Full paths are not needed.

Link to post

I cannot get this plugin to work.

 

I've attached a screenshot of my configuration, but for some reason no files i remove are inside the .Recycle.Bin folder (it's not even created).

 

The only thing i see is some shortcuts inside /mnt/RecycleBin (but the the shortcuts points to nothing as there are no .Recycle.Bin folders in any of my shares).

 

Screenshot_1.jpg.2173c71a9640459050c6e9d3786552af.jpg

Screenshot_2.jpg.cccde6abec27172e10f8b85a779c5519.jpg

Link to post

I cannot get this plugin to work.

 

I've attached a screenshot of my configuration, but for some reason no files i remove are inside the .Recycle.Bin folder (it's not even created).

 

The only thing i see is some shortcuts inside /mnt/RecycleBin (but the the shortcuts points to nothing as there are no .Recycle.Bin folders in any of my shares).

How are you removing the files? This is just for files you delete over the network using SMB.
Link to post

I cannot get this plugin to work.

 

I've attached a screenshot of my configuration, but for some reason no files i remove are inside the .Recycle.Bin folder (it's not even created).

 

The only thing i see is some shortcuts inside /mnt/RecycleBin (but the the shortcuts points to nothing as there are no .Recycle.Bin folders in any of my shares).

How are you removing the files? This is just for files you delete over the network using SMB.

 

Doh! Mostly through SSH (rm command) and FTP. But thanks for the clarification. Is there any way you can have like a recycle bin for rm commands?

Link to post

Maybe a alias for rm - that instead of just deletes the file, moves it to the recyclebin folder in that share?

 

 

something like (not tested - not very good at bash)

 

 

alias rrm="IFS="/" read -ra PARTS <<< "$(pwd)" ; mv $0 /${PARTS[0]}/${PARTS[1]}/.Recycle.Bin/"

 

rrm would be for recycle delete, leaving rm for perm delete

 

looks like it might have to be made into a bash script and have the rrm alias call the bash script instead

 

Myk

Link to post

ok, this works

 

 

/boot/scripts/rrm.sh

 

#!/bin/bash

IFS="/" read -ra PARTS <<< "$(pwd)"

mv "$1" "/${PARTS[1]}/${PARTS[2]}/.Recycle.Bin/"

 

 

alias rrm="/boot/scripts/rrm.sh"

 

 

test on junk file to make sure

Myk

Link to post
  • 1 month later...
  • 4 weeks later...

Hello everyone,

 

great plugin.

 

Just one question, is there a way to  really hide the .Recycle.Bin folder?

 

The windows recycle bin is a "protected system folder". Not "just" a hidden folder. So, you can see hidden folders, but still not the recycle bin. Which I find great.

 

I don't want to samba share the recycle bin, because it's a simple "safety net" for users, who accidentally delete a file. They should only be restored by the admin or deleted by the cron job.

 

I read that samba can "veto" files. This way these files/folders aren't exported at all. How can I achieve that?

 

Thanks and best regards,

Henryk

Link to post
  • 1 month later...

I do not have issues at all with this plugin but I see an error message on the system console....probably a cosmetic problem?  :D

Is anyone having any idea? Thanks a lot.

 

Make a change is the Recycle Bin settings and Apply.  The message will go away.

Link to post
  • dlandon changed the title to Recycle Bin (vfs recycle) for SMB Shares

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.