Recycle Bin (vfs recycle) for SMB Shares


dlandon

Recommended Posts

3 hours ago, jonasled said:

How can I generate the diagnostics. I'l relativly new to unraid. The other problem is, that if the plugin is installed the webui is unusable, so I can't generate diagnsotics there.

Tools>Diagnostics and attach the zip file to your next post.

 

You can also just run diagnostics in the console.

Link to comment

Hello guys,

 

I've a little suggestion. Maby for next update you could modify the remove commands in "vfs_recycle_empty()" and "vfs_recycle_remove()" functions in "rc.recycle" like so:

 

find /mnt/RecycleBin/User\ Shares/*/* ! -name "desktop.ini" -delete &>/dev/null

 

This prevents a file called "desktop.ini" from deleting. Furthermore it would be nice if there could be an option on the settings page of the plugin like "Exclude file from deleting:" where you could add files, which should stay in the recycle bin (like my desktop.ini).

 

Maby this is possible. Anyways thank you dlandon for the great plugin.

 

 

Link to comment
On 3/13/2021 at 9:14 AM, joie95 said:

Hello guys,

 

I've a little suggestion. Maby for next update you could modify the remove commands in "vfs_recycle_empty()" and "vfs_recycle_remove()" functions in "rc.recycle" like so:

 

find /mnt/RecycleBin/User\ Shares/*/* ! -name "desktop.ini" -delete &>/dev/null

 

This prevents a file called "desktop.ini" from deleting. Furthermore it would be nice if there could be an option on the settings page of the plugin like "Exclude file from deleting:" where you could add files, which should stay in the recycle bin (like my desktop.ini).

 

Maby this is possible. Anyways thank you dlandon for the great plugin.

 

 

This is not what the recycle bin is for.  Store a backup copy somewhere.

 

Extend the aged days to a longer period to keep files in the recycle bin longer.

Link to comment

I was wondering if a couple features would be feasible.  I have multiple shares that Recycle Bin is watching.  Most of them, my "general" settings I have are fine for, due to the amount of data occurring.  I do have a specific share where I do a lot of short lived, large file transfers.  These files live here for just a few hours, to a day.  This share uses the cache drive for speed improvements and the files on the cache drive move to the RecycleBin folder and end up filling it within a day.  Would it be possible for Recycle Bin to have per-share settings.

 

Also, how about a setting for "Included shares" in addition to "Excluded shares"?

Edited by ComputerGuyMike
Link to comment
4 hours ago, ComputerGuyMike said:

This share uses the cache drive for speed improvements and the files on the cache drive move to the RecycleBin folder and end up filling it within a day.  Would it be possible for Recycle Bin to have per-share settings.

 

Exclude the share.

 

4 hours ago, ComputerGuyMike said:

Also, how about a setting for "Included shares" in addition to "Excluded shares"?

Not necessary and too prone to confusion.  Al shares are included unless excluded.  Seems pretty simple to me.

Link to comment

If I move a file (over SMB) from Share A to Share B, and Share A has Recycle Bin enabled, the file will exist on Share B and in Share A's Recycle Bin. Essentially duplicated.

 

Not the biggest problem but if say someone did a bunch of moves between cache-enabled shares it could end up unexpectedly filling the cache pool.

 

Has anyone else noticed this?

I'm on a Mac client and I've tweaked some SMB parameters so it's possible this is a "me" problem.

Link to comment
59 minutes ago, CS01-HS said:

If I move a file (over SMB) from Share A to Share B, and Share A has Recycle Bin enabled, the file will exist on Share B and in Share A's Recycle Bin. Essentially duplicated.

If the file in Share B is being replaced, the Share B file will go to the recycle bin.

Link to comment
2 hours ago, dlandon said:

If the file in Share B is being replaced, the Share B file will go to the recycle bin.

 

Right. In my example the file only existed on Share A prior to the move.

 

I ran a test:

  1. Uploaded test.mp4 to share Public
  2. Moved test.mp4 from share Public to share system

Result: test.mp4 exists in share system and in share Public's recycle bin

 

Note:

  • This is over SMB from a Mac client
  • Both shares have cache enabled
  • test.mp4 existed on neither share prior to the test

Here's the File Activity log beginning just before the move (note the last few lines)

 

EDIT:

 

I suspect there's no specific SMB command to "move" files between shares and what's happening is the client first copies (to the destination) then deletes (from the source) so there's no way for your plugin or any other to differentiate. I tried to confirm but this low-level samba stuff is beyond me.

 

Long-winded way of saying "you should probably ignore my original post but users beware of large moves."

 

** Cache
Mar 21 12:00:29 OPEN => /mnt/cache/Public/.DS_Store
Mar 21 12:00:29 ATTRIB => /mnt/cache/Public/.DS_Store
Mar 21 12:00:29 ATTRIB => /mnt/cache/Public/.DS_Store
Mar 21 12:00:29 CREATE => /mnt/cache/system/test.mp4
Mar 21 12:00:29 OPEN => /mnt/cache/system/test.mp4
Mar 21 12:00:29 ATTRIB => /mnt/cache/system/test.mp4
Mar 21 12:00:29 ATTRIB => /mnt/cache/system/test.mp4
Mar 21 12:00:29 ATTRIB => /mnt/cache/system/test.mp4
Mar 21 12:00:29 ATTRIB => /mnt/cache/system/test.mp4
Mar 21 12:00:29 ATTRIB => /mnt/cache/system/test.mp4
Mar 21 12:00:29 ATTRIB => /mnt/cache/system/test.mp4
Mar 21 12:00:29 ATTRIB => /mnt/cache/system/test.mp4
Mar 21 12:00:29 ATTRIB => /mnt/cache/system/test.mp4
Mar 21 12:00:29 ATTRIB => /mnt/cache/system/test.mp4
Mar 21 12:00:29 OPEN => /mnt/cache/system/test.mp4
Mar 21 12:00:29 OPEN => /mnt/cache/system/test.mp4
Mar 21 12:00:29 OPEN => /mnt/cache/system/test.mp4
Mar 21 12:00:30 OPEN => /mnt/cache/Public/test.mp4
Mar 21 12:00:30 OPEN => /mnt/cache/system/test.mp4
Mar 21 12:00:30 ATTRIB => /mnt/cache/system/test.mp4
Mar 21 12:00:30 ATTRIB => /mnt/cache/system/test.mp4
Mar 21 12:00:30 ATTRIB => /mnt/cache/system/test.mp4
Mar 21 12:00:30 ATTRIB => /mnt/cache/system/test.mp4
Mar 21 12:00:30 ATTRIB => /mnt/cache/system/test.mp4
Mar 21 12:00:31 ATTRIB => /mnt/cache/system/test.mp4
Mar 21 12:00:31 ATTRIB => /mnt/cache/system/test.mp4
Mar 21 12:00:31 ATTRIB => /mnt/cache/system/test.mp4
Mar 21 12:00:31 ATTRIB => /mnt/cache/system/test.mp4
Mar 21 12:00:31 ATTRIB => /mnt/cache/system/test.mp4
Mar 21 12:00:31 ATTRIB => /mnt/cache/system/test.mp4
Mar 21 12:00:31 ATTRIB => /mnt/cache/system/test.mp4
Mar 21 12:00:31 ATTRIB => /mnt/cache/system/test.mp4
Mar 21 12:00:31 ATTRIB => /mnt/cache/system/test.mp4
Mar 21 12:00:31 ATTRIB => /mnt/cache/system/test.mp4
Mar 21 12:00:31 ATTRIB => /mnt/cache/system/test.mp4
Mar 21 12:00:31 ATTRIB => /mnt/cache/system/test.mp4
Mar 21 12:00:31 ATTRIB => /mnt/cache/system/test.mp4
Mar 21 12:00:31 ATTRIB => /mnt/cache/system/test.mp4
Mar 21 12:00:31 ATTRIB => /mnt/cache/system/test.mp4
Mar 21 12:00:31 ATTRIB => /mnt/cache/system/test.mp4
Mar 21 12:00:31 ATTRIB => /mnt/cache/system/test.mp4
Mar 21 12:00:31 ATTRIB => /mnt/cache/Public/test.mp4
Mar 21 12:00:31 OPEN => /mnt/cache/system/test.mp4
Mar 21 12:00:31 ATTRIB => /mnt/cache/system/test.mp4
Mar 21 12:00:31 ATTRIB => /mnt/cache/system/test.mp4
Mar 21 12:00:31 ATTRIB => /mnt/cache/system/test.mp4
Mar 21 12:00:31 ATTRIB => /mnt/cache/system/test.mp4
Mar 21 12:00:31 ATTRIB => /mnt/cache/system/test.mp4
Mar 21 12:00:31 ATTRIB => /mnt/cache/system/test.mp4
Mar 21 12:00:31 ATTRIB => /mnt/cache/system/test.mp4
Mar 21 12:00:31 ATTRIB => /mnt/cache/Public/test.mp4
Mar 21 12:00:31 ATTRIB => /mnt/cache/Public/test.mp4
Mar 21 12:00:31 ATTRIB => /mnt/cache/Public/test.mp4
Mar 21 12:00:31 ATTRIB => /mnt/cache/Public/test.mp4
Mar 21 12:00:31 ATTRIB,ISDIR => /mnt/cache/Public
Mar 21 12:00:31 ATTRIB,ISDIR => /mnt/cache/Public/
Mar 21 12:00:31 CREATE,ISDIR => /mnt/cache/Public/.Recycle.Bin
Mar 21 12:00:31 ATTRIB,ISDIR => /mnt/cache/Public/.Recycle.Bin
Mar 21 12:00:31 ATTRIB,ISDIR => /mnt/cache/Public
Mar 21 12:00:31 ATTRIB,ISDIR => /mnt/cache/Public/
Mar 21 12:00:31 MOVED_FROM => /mnt/cache/Public/test.mp4
Mar 21 12:00:31 ATTRIB => /mnt/cache/Public/.Recycle.Bin/test.mp4
Mar 21 12:00:32 OPEN => /mnt/cache/system/test.mp4
Mar 21 12:00:32 OPEN => /mnt/cache/system/test.mp4

 

Edited by CS01-HS
Link to comment

What's the syntax?  I want to exclude folder "Unraid Downloads" in share "Media".

 

I've tried:

 

Media/Undraid Downloads

*Unraid Downloads

/mnt/user/Media/Unraid Downloads

 

but deleted files still go to the bin.

 

edit: *Unraid*Downloads works for now, but would like to specify the exact folder if possible.  Thanks again!

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

What's the syntax?  I want to exclude folder "Unraid Downloads" in share "Media".

 

I've tried:

 

Media/Undraid Downloads

*Unraid Downloads

/mnt/user/Media/Unraid Downloads

 

but deleted files still go to the bin.

 

edit: *Unraid*Downloads works for now, but would like to specify the exact folder if possible.  Thanks again!

Quote it 'Unraid Downloads".

Link to comment

I'm also having some trouble with this.  I assumed exact pathing would be how youre supposed to do it but typing /mnt/user/files/downloads for exclude doesnt see, to work.

I typed just:

Downloads

 

And that works.... but I have other "downloads" folders elsewhere on my shares and I don't want to exclude those folders.

Link to comment
17 minutes ago, 007craft said:

I'm also having some trouble with this.  I assumed exact pathing would be how youre supposed to do it but typing /mnt/user/files/downloads for exclude doesnt see, to work.

I typed just:

Downloads

 

And that works.... but I have other "downloads" folders elsewhere on my shares and I don't want to exclude those folders.

You could create unique names.  I'll have to look at possibly a way to exclude directories by share.

Link to comment

I'm releasing a new version that will allow specifying an excluded directory in a particular share.  You specify a specific share directory to exclude by:

 

share/directory

 

The full mount path is not necessary.  /mnt/user/ is assumed.

 

If you want to specify a directory to be excluded in all shares just use:

 

directory

 

You can exclude UD mounted disks also by:

 

mountpoint/directory

 

The full mount path is not necessary.  /mnt/disks/ is assumed.

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