Recycle Bin (vfs recycle) for SMB Shares


dlandon

Recommended Posts

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 comment

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 comment

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 comment

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 comment

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 comment
  • 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.

Link to comment
  • 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 comment

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 comment

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 comment

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 comment

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 comment

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 comment

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 comment
  • 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 comment
  • 1 month later...
  • 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.