Recycle Bin (vfs recycle) for SMB Shares


dlandon

794 posts in this topic Last Reply

Recommended Posts

I had a chance to try this, installed and started and tested it, and must say it's very well implemented!  Nice job!

 

In my view, there's one flaw, but perhaps it's unimportant to others, the fact that the original timestamps are not preserved.  From the days of DOS and Windows, they have always been important for me, and I depend on them for certain (but not all) files, and run software that depends on their accuracy for its files.  I don't know if it's possible to save them, at least the 'last date modified'?  It would be incompatible with your aging feature, a nice feature too.  If I'm the only one interested, then don't waste any time on it, as I may not use this after all.  I have many flaws, but strangely this is not one of them, and it's extremely rare for me to wrongly delete a file (I'm sure I must have though).  Plus, I'm the only user on my server.

 

I've added it to the Upgrading to UnRAID v6 guide (Other Plugins section), and would appreciate your review of the entry.

 

If you have any interest in adding an advanced feature, you might want to look at this topic.  It might be possible to add crude auditing capabilities.  Speaking somewhat ignorantly, I wonder if it's as simple as adding the option to add specific SMB options, enable logging, then provide a box for viewing the log, so that a user could look for 'who deleted what' or other info.  Might be a nice feature, if easy to add.  Might help catch which family member needs 'reeducating' or which employee is responsible for vandalism.

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

I had a chance to try this, installed and started and tested it, and must say it's very well implemented!  Nice job!

 

In my view, there's one flaw, but perhaps it's unimportant to others, the fact that the original timestamps are not preserved.  From the days of DOS and Windows, they have always been important for me, and I depend on them for certain (but not all) files, and run software that depends on their accuracy for its files.  I don't know if it's possible to save them, at least the 'last date modified'?  It would be incompatible with your aging feature, a nice feature too.  If I'm the only one interested, then don't waste any time on it, as I may not use this after all.  I have many flaws, but strangely this is not one of them, and it's extremely rare for me to wrongly delete a file (I'm sure I must have though).  Plus, I'm the only user on my server.

 

I've added it to the Upgrading to UnRAID v6 guide (Other Plugins section), and would appreciate your review of the entry.

 

If you have any interest in adding an advanced feature, you might want to look at this topic.  It might be possible to add crude auditing capabilities.  Speaking somewhat ignorantly, I wonder if it's as simple as adding the option to add specific SMB options, enable logging, then provide a box for viewing the log, so that a user could look for 'who deleted what' or other info.  Might be a nice feature, if easy to add.  Might help catch which family member needs 'reeducating' or which employee is responsible for vandalism.

 

The time stamp for deletion is the only way I can purge files based on date.  I don't think I can preserve the original last modified date and deleted date.

 

The write up looks good.

 

There is an "audit" module in samba, but I don't know much about it.  I'll see if it would apply to this situation.  It may be as easy as adding the module to the samba configuration and providing a log browser.

Link to post

Wondering if I am understanding this correctly.  If I go to Settings/SMB and set "hide dot files" to yes, I shouldn't see the recycle bin.  Have I got that right.  I've done that and I still have the recycle bin showing.  Any idea what I may be doing wrong?  Thanks, again, for a great plugin.

Link to post

Wondering if I am understanding this correctly.  If I go to Settings/SMB and set "hide dot files" to yes, I shouldn't see the recycle bin.  Have I got that right.  I've done that and I still have the recycle bin showing.  Any idea what I may be doing wrong?  Thanks, again, for a great plugin.

 

That should do it.

Link to post

Wondering if I am understanding this correctly.  If I go to Settings/SMB and set "hide dot files" to yes, I shouldn't see the recycle bin.  Have I got that right.  I've done that and I still have the recycle bin showing.  Any idea what I may be doing wrong?  Thanks, again, for a great plugin.

 

That should do it.

 

But it isn't.  I have hide dot files set to yes, but, I'm still seeing the recycle bin. :(

Link to post

Wondering if I am understanding this correctly.  If I go to Settings/SMB and set "hide dot files" to yes, I shouldn't see the recycle bin.  Have I got that right.  I've done that and I still have the recycle bin showing.  Any idea what I may be doing wrong?  Thanks, again, for a great plugin.

 

That should do it.

 

You're talking about in the shares when browsing with Windows right?  Try re-starting the computer that is browsing the shares.

 

But it isn't.  I have hide dot files set to yes, but, I'm still seeing the recycle bin. :(

Link to post

@dlandon  -  Great plugin but would it be possible to issue updates via the Plugin 'update' button as opposed to remove/reinstall?

Lots of the updates have been done that way.

 

The remove/reinstall route has been required a couple of times as changes to the internal workings for new features and how/where .RecycleBin folders have been used have have meant it was not easy to migrate to a new release.  I think things are now probably stable enough that we will not see too many of the remove/reinstall type updates.

Link to post

@dlandon  -  Great plugin but would it be possible to issue updates via the Plugin 'update' button as opposed to remove/reinstall?

 

Thanks!

 

When changes are made to the settings and/or the default smb-extra.conf, there is no way to update without an uninstall and re-install and get the new feature(s) to work.  I believe that those changes are behind us and it should no longer be an issue.

 

I try to give a heads up when the uninstall/re-install procedure is needed.  Otherwise the normal plugin update will work.

Link to post

thanks for the great work!

This functionality is FANTASTIC

 

I didn't know much about the recycle bin when I started this plugin project.  I responded to someone asking if the faltering V5 plugin could be resurrected and made to work on V6.1.  As I learned what the recycle bin was about, I found myself impressed with the functionality.  There were some interesting challenges, but I'm happy with the outcome.

Link to post
  • 3 weeks later...

Quick question,

Right now, the plugin creates a .Recycle.Bin folder in every disk. Is it possible to edit the smb-extra.conf and have it create the folder ONLY in ...say... disk 1.

Something like:

path = /mnt/disk3/.Recycle.Bin

If possible, where would the "path" go?

 

Thank you

Link to post

Quick question,

Right now, the plugin creates a .Recycle.Bin folder in every disk. Is it possible to edit the smb-extra.conf and have it create the folder ONLY in ...say... disk 1.

Something like:

path = /mnt/disk3/.Recycle.Bin

If possible, where would the "path" go?

 

Thank you

 

The plugin I started with had the .Recycle.Bin in one location.  I set up the .Recycle.Bin in one place like you are suggesting in the first release of the V6 plugin, but it created a lot of problems.  The smb-extra.conf settings are global and apply to all shares.  Setting up one recycle bin for all shares is very messy and created many problems.  vfs_recycle is designed to work per share and not globally.

 

What is it that you want to do?

 

I would discourage you from trying to customize vfs_recycle.  It is set up to work well the way it is with the plugin and vfs_recycle is a bit complicated and documentation is lacking.

Link to post

IF it is TROUBLE, nevermind. I just did not like to see .Recycle.Bin on every disk. I have one disk destined for all daily write/delete of documents (dropbox and such), and I wanted to put it there. The rest of the disks "Archive" all my media. I do not like those other disks spinning up frequently for no reason. But like I said, nevermind if it is too much trouble. Thank you anyways.

Link to post

IF it is TROUBLE, nevermind. I just did not like to see .Recycle.Bin on every disk. I have one disk destined for all daily write/delete of documents (dropbox and such), and I wanted to put it there. The rest of the disks "Archive" all my media. I do not like those other disks spinning up frequently for no reason. But like I said, nevermind if it is too much trouble. Thank you anyways.

 

If you don't delete anything from those other disks then you won't have a .Recycle.Bin in use there and it shouldn't spin up those drives.  :P

Link to post

IF it is TROUBLE, nevermind. I just did not like to see .Recycle.Bin on every disk. I have one disk destined for all daily write/delete of documents (dropbox and such), and I wanted to put it there. The rest of the disks "Archive" all my media. I do not like those other disks spinning up frequently for no reason. But like I said, nevermind if it is too much trouble. Thank you anyways.

 

The plugin enables the vfs_recycle feature built into samba and manages the deleted files.  It was designed to do per share recycle bins and that's where the .Recycle.Bin folders go.  Because unRAID distributes user shares to individual disks, the .Recycle.Bin folder for a share will be on separate disks depending on how unRAID distributes the share files to the disks.  If you manage your data by disk shares, then you will get a .Recycle.Bin folder on each disk.

 

I don't understand the concern over excess disk spin ups.  When a share file is deleted, the disk the file is on will spin up the disk to delete that file and the file will be moved to the .Recycle.Bin.  If you have a cache drive, the file will end up on the cache drive in the share .Recycle.Bin folder and will be moved back to the array when the nightly mover is run.  If you don't have a cache drive, the file should be moved to the .Recycle.Bin on the disk where the file resides.

 

If you browse the Recycle Bin on the webgui, it may spin up disks to check on the size of the Recycle Bin and when browsing the shares in the webgui.  Cache_dirs can help with spin ups of disk drives.

 

What do you see that concerns you about excessive disk spin ups?

Link to post
  • 3 weeks later...

Hi everyone,

 

I'm using vfs recycle for my Windows Media Center Recorded TV. When I delete the file in WMC, vfs recycle moves it to .Recycle Bin, but as WMC also has access to that directory, the file re-appears in the Recorded Shows list a few seconds later. Initially I told my family just to delete it a second time, but I would like to have a solution that avoids this.

 

I'm thinking that I will move the 'Recorded TV' directory down to a sub-directory of a 'TV' share which I'm sure will work, but wondering if anyone could think of another solution that's a little more elegant and saves me having to change settings in WMC, Plex, Emby, etc?

Link to post

Hi everyone,

 

I'm using vfs recycle for my Windows Media Center Recorded TV. When I delete the file in WMC, vfs recycle moves it to .Recycle Bin, but as WMC also has access to that directory, the file re-appears in the Recorded Shows list a few seconds later. Initially I told my family just to delete it a second time, but I would like to have a solution that avoids this.

 

I'm thinking that I will move the 'Recorded TV' directory down to a sub-directory of a 'TV' share which I'm sure will work, but wondering if anyone could think of another solution that's a little more elegant and saves me having to change settings in WMC, Plex, Emby, etc?

 

Do you have 'Hide "dot" files:' set to no in SMB settings?

Link to post

Hi everyone,

 

I'm using vfs recycle for my Windows Media Center Recorded TV. When I delete the file in WMC, vfs recycle moves it to .Recycle Bin, but as WMC also has access to that directory, the file re-appears in the Recorded Shows list a few seconds later. Initially I told my family just to delete it a second time, but I would like to have a solution that avoids this.

 

I'm thinking that I will move the 'Recorded TV' directory down to a sub-directory of a 'TV' share which I'm sure will work, but wondering if anyone could think of another solution that's a little more elegant and saves me having to change settings in WMC, Plex, Emby, etc?

 

Do you have 'Hide "dot" files:' set to no in SMB settings?

 

That'd be a good option but it'll affect all shares, which I don't want at this stage. If I can hide dot files only on this share I'll definitely do it, otherwise hoping you might have another option? :-)

Link to post
  • 3 months 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.