Recycle Bin (vfs recycle) for SMB Shares


dlandon

Recommended Posts

4 hours ago, gacpac said:

I would be super cool to add a restore button in the plugin.

Sent from my Pixel 2 XL using Tapatalk
 

You can also browse the recycle bin through the plugin webui and click on the file you want to restore and it will be downloaded.  You can then put it back where you want.

Link to comment
15 minutes ago, gacpac said:

Well like I said. "it's a cool idea" maybe for the future.

While your idea may be cool, it's not very practical.  This doesn't happen enough for the investment in time to implement.

35 minutes ago, trurl said:

Seems orders of magnitude more complicated to implement.

Yes.  For very little gain.

Link to comment
  • 3 weeks later...

Recycle Bin:  A folder in which to store 'deleted' files.  Agreed?  If so, why the need?  The 'need' is in the name "Recycle" - i.e. to use again or to reuse.  'Deleted' files in this context are not PERMANENTLY deleted, but rather TEMPORARILY deleted (i.e. easily restored).  

 

I wish to restore the files in my own Unraid servers' Recycle Bin.  How is this accomplished?  I missed the steps in the plugin post I guess....  Perhaps the answer is in the 23 pages?  If so, apologies for missing the explanation.

 

Can anyone please help?

 

Thanks in advance.

 

WMW 

Link to comment

2019.03.08b

 

Is there any know issues with Age not being respected? I'm not sure why but a couple shares have .Recycle.Bin data from last year still. Age is set to 3 days.

 

When I try running Remove Aged Files manually the page just refreshes and nothing happens. I'm wondering if theres any way to see the delete command its running, maybe theres an error I'm not getting to see 

 

Apr  8 15:04:14 storage ool www[25259]: /usr/local/emhttp/plugins/recycle.bin/scripts/rc.recycle.bin 'purge'
Apr  8 15:04:14 storage Recycle Bin: User: Files older than 3 days have been removed

 

Capture.PNG

Edited by iarp
add image
Link to comment
19 minutes ago, iarp said:

2019.03.08b

 

Is there any know issues with Age not being respected? I'm not sure why but a couple shares have .Recycle.Bin data from last year still. Age is set to 3 days.

 

When I try running Remove Aged Files manually the page just refreshes and nothing happens. I'm wondering if theres any way to see the delete command its running, maybe theres an error I'm not getting to see 

 


Apr  8 15:04:14 storage ool www[25259]: /usr/local/emhttp/plugins/recycle.bin/scripts/rc.recycle.bin 'purge'
Apr  8 15:04:14 storage Recycle Bin: User: Files older than 3 days have been removed

 

Capture.PNG

Are you having any other issues with other shares or files not purging out the aged files?

 

Run this command and see if there are any errors.

/usr/local/emhttp/plugins/recycle.bin/scripts/rc.recycle.bin purge

I wouldn't expect to see any errors.

 

The other thing you can check are the dates of the files.  Some time ago the aging determination was changed and these files might have an issue with the dates.

2017.05.07
Add: Changed the recycle bin aging to the last access date and don't change the modify date when the file is put in the recycle bin.

 

Link to comment

I have not had any issues stand out to me, other than noticing this just today.

root@storage:~# /usr/local/emhttp/plugins/recycle.bin/scripts/rc.recycle.bin purge
Removing aged files...
Aged files removed
root@storage:/mnt/user/downloads/.Recycle.Bin# stat 2019-20\ Offer\ of\ Commitment.pdf
  File: 2019-20 Offer of Commitment.pdf
  Size: 427620          Blocks: 840        IO Block: 4096   regular file
Device: 22h/34d Inode: 21807502    Links: 1
Access: (0666/-rw-rw-rw-)  Uid: (   99/  nobody)   Gid: (  100/   users)
Access: 2019-03-18 12:43:33.000000000 -0400
Modify: 2019-03-18 12:17:50.000000000 -0400
Change: 2019-03-19 02:07:58.000000000 -0400
 Birth: -
root@storage:/mnt/user/downloads/.Recycle.Bin# stat Auto\ Maintenance_removed\@group.calendar.google.com.ics
  File: Auto [email protected]
  Size: 8075            Blocks: 16         IO Block: 4096   regular file
Device: 22h/34d Inode: 924         Links: 1
Access: (0666/-rw-rw-rw-)  Uid: (   99/  nobody)   Gid: (  100/   users)
Access: 2019-03-10 13:03:46.000000000 -0400
Modify: 2018-12-24 17:48:18.000000000 -0500
Change: 2019-03-10 13:03:46.000000000 -0400
 Birth: -

Update:

Found the command thats not finding anything:

find /mnt/RecycleBin/User\ Shares/*/*/* -atime +$AGE -exec rm -rf {} \; 2>/dev/null

removing one /* from the path and it works.

Edited by iarp
Link to comment
13 hours ago, jonathanm said:

One page back.

https://forums.unraid.net/topic/41044-recycle-bin-vfs-recycle-for-64-and-later-versions/?do=findComment&comment=732080

 

Or, on the VERY FIRST POST in the thread, 4th paragraph down.

In truth I read all 23 pages and noted the 2 sentences you refer to.  Finding the files was not my issue.  "Restoring" the files was the issue.  In Windows (my only previous OS experience) one can 'restore' any/all files in the Recycle Bin and they then reappear in the places from whence they were deleted and vanish from the Recycle Bin.  This docker lacks a "Restore" radio button.  I am to "copy" the files I wish to 'undelete' and then I....what?  Presumably paste them into the share I deleted from, but what happens if I have several folders in this share.  Do the 'undeleted' files wind up from whence they came? 

 

My question probably sounds as lame to you as your response does to me.  Don't construe this as criticism.  You're a computer guy with considerable linux background; I'm someone who struggles with Windows (zero Mac/linux experience), but I am very literate in English.  Our differences make meaningful communication quite challenging.  

 

Thank you.

Link to comment
3 hours ago, iarp said:

I have not had any issues stand out to me, other than noticing this just today.


root@storage:~# /usr/local/emhttp/plugins/recycle.bin/scripts/rc.recycle.bin purge
Removing aged files...
Aged files removed

root@storage:/mnt/user/downloads/.Recycle.Bin# stat 2019-20\ Offer\ of\ Commitment.pdf
  File: 2019-20 Offer of Commitment.pdf
  Size: 427620          Blocks: 840        IO Block: 4096   regular file
Device: 22h/34d Inode: 21807502    Links: 1
Access: (0666/-rw-rw-rw-)  Uid: (   99/  nobody)   Gid: (  100/   users)
Access: 2019-03-18 12:43:33.000000000 -0400
Modify: 2019-03-18 12:17:50.000000000 -0400
Change: 2019-03-19 02:07:58.000000000 -0400
 Birth: -
root@storage:/mnt/user/downloads/.Recycle.Bin# stat Auto\ Maintenance_removed\@group.calendar.google.com.ics
  File: Auto [email protected]
  Size: 8075            Blocks: 16         IO Block: 4096   regular file
Device: 22h/34d Inode: 924         Links: 1
Access: (0666/-rw-rw-rw-)  Uid: (   99/  nobody)   Gid: (  100/   users)
Access: 2019-03-10 13:03:46.000000000 -0400
Modify: 2018-12-24 17:48:18.000000000 -0500
Change: 2019-03-10 13:03:46.000000000 -0400
 Birth: -

Update:

Found the command thats not finding anything:


find /mnt/RecycleBin/User\ Shares/*/*/* -atime +$AGE -exec rm -rf {} \; 2>/dev/null

removing one /* from the path and it works.

Thought I had all this worked out.  Fixed in the next release.

Link to comment
1 hour ago, WTF? said:

In truth I read all 23 pages and noted the 2 sentences you refer to.  Finding the files was not my issue.  "Restoring" the files was the issue.  In Windows (my only previous OS experience) one can 'restore' any/all files in the Recycle Bin and they then reappear in the places from whence they were deleted and vanish from the Recycle Bin.  This docker lacks a "Restore" radio button.  I am to "copy" the files I wish to 'undelete' and then I....what?  Presumably paste them into the share I deleted from, but what happens if I have several folders in this share.  Do the 'undeleted' files wind up from whence they came? 

 

My question probably sounds as lame to you as your response does to me.  Don't construe this as criticism.  You're a computer guy with considerable linux background; I'm someone who struggles with Windows (zero Mac/linux experience), but I am very literate in English.  Our differences make meaningful communication quite challenging.  

 

Thank you.

I appreciate what it is that you are looking for and can understand your frustration.  This plugin is offered to help recover deleted files.  As you may have seen, the file versions are noted by a copy number.  It would be nice to have a recover button to restore the file back to it's original location, but that would take a major effort in creating a file browser with that capability.  I volunteer my efforts and do not get paid for my time.  It's not an undertaking I am interested in investing in for the few times it would be used.  While it is a bit cumbersome to have to download the file and copy it to the restored location, this is not an everyday operation.

Link to comment
On 4/8/2019 at 10:45 PM, dlandon said:

I appreciate what it is that you are looking for and can understand your frustration.  This plugin is offered to help recover deleted files.  As you may have seen, the file versions are noted by a copy number.  It would be nice to have a recover button to restore the file back to it's original location, but that would take a major effort in creating a file browser with that capability.  I volunteer my efforts and do not get paid for my time.  It's not an undertaking I am interested in investing in for the few times it would be used.  While it is a bit cumbersome to have to download the file and copy it to the restored location, this is not an everyday operation.

Dear "dlandon",

 

Firstly, thank you (!!) graciously for responding and for writing an absolutely lucid explanation in a very kind manner.  I understand now and can proceed down a different avenue to accomplish my relevant objective (the restoration of 1 TB of music files).  I am astonished to learn you are not compensated for your efforts.  There appears to be much work involved in writing the docker image, but responding to the users must be more effort by an order of magnitude.  Goodness gracious thank you!

 

Bill Walker  

Link to comment
8 minutes ago, WTF? said:

Firstly, thank you (!!) graciously for responding and for writing an absolutely lucid explanation in a very kind manner.  I understand now and can proceed down a different avenue to accomplish my relevant objective (the restoration of 1 TB of music files).  I am astonished to learn you are not compensated for your efforts.  There appears to be much work involved in writing the docker image, but responding to the users must be more effort by an order of magnitude.  Goodness gracious thank you!

Just like almost all of the help and advice you get on the forum, almost all of the "addons" for Unraid are done by fellow users without any compensation except the occasional thanks and possibly donations. Many of these addons have an associated Donate button on the Apps page.

Link to comment

Dear "trurl",

 

Got it, but with qualifications requested (i.e. the relationship(s) between your words "almost", "fellow users" and "compensation").  I think you're saying some of the forum contributions are not from "fellow users", but from professionals employed by LimeTech, yes? (e.g. Panozzo and Squid).  And what of authors of dockers?  I'm not asking to be a jerk and quantification isn't my business.  I do try to be fair and I'm no miser.

 

Bill Walker

Link to comment
4 hours ago, WTF? said:

Dear "trurl",

 

Got it, but with qualifications requested (i.e. the relationship(s) between your words "almost", "fellow users" and "compensation").  I think you're saying some of the forum contributions are not from "fellow users", but from professionals employed by LimeTech, yes? (e.g. Panozzo and Squid).  And what of authors of dockers?  I'm not asking to be a jerk and quantification isn't my business.  I do try to be fair and I'm no miser.

 

Bill Walker

The one you named (squid) are not paid by the company.

 

Only the following 4 @limetech, @jonp @eschultz and @SpencerJ as listed on this page: https://unraid.net/about

 

Everyone else is just a member of the community.

Edited by BRiT
Clarification on who was named...
Link to comment
1 hour ago, WTF? said:

Got it, but with qualifications requested (i.e. the relationship(s) between your words "almost", "fellow users" and "compensation").  I think you're saying some of the forum contributions are not from "fellow users", but from professionals employed by LimeTech, yes? (e.g. Panozzo and Squid).  And what of authors of dockers?  I'm not asking to be a jerk and quantification isn't my business.  I do try to be fair and I'm no miser.

Only those users listed as "Administrator" work for limetech. Squid is definitely not one of those. That other user you mentioned there doesn't seem to exist, perhaps a typo.

 

There are only a few. You probably won't encounter any of them on the vast majority of threads.

 

Just to clarify some technical details.

 

Dockers are typically applications. They run inside a container, which you can think of as a small virtual machine with a single purpose. Other than using Unraid for storage and networking, dockers are separate things, and will often have their own webUI. Their support threads are in the Docker Support subforum.

 

Plugins, of which this support thread is one example, are typically enhancements to Unraid functionality. They are usually accessed as addons to the Unraid webUI. Their support threads are in this subforum, Plugin Support.

 

You can assume that all dockers except for those few in the official limetech repository, and all plugins, are written by other Unraid users for free to make Unraid more useful to everyone.

Link to comment
3 hours ago, WTF? said:

professionals employed by LimeTech, yes? (e.g. Panozzo and Squid).

 

Quick note, Jon Panozzo is indeed @jonp, a paid employee. Squid (Andrew) is not. Also, the applications running inside dockers are almost exclusively NOT authored by anyone that posts here or is employed by limetech, only the wrapper that allows easy integration and basic install instruction is actually maintained by guys (and girls) that post here. Plugins like this one that we are polluting the support thread for ARE generally authored and supported by members.

Link to comment

Dear BRIT, trurl and jonathanm,

 

Thanks most kindly for the information and education.  I am forever amazed at the many things I don't know.  I am also amazed at the herculean efforts put forth by so many of the contributors to this forum.  And they contribute out of goodness and generosity?!?!  Holy crow!!!  I am all aglow at learning this.  I live in the United States and I think I recall a time long ago when such was common.  Now it seems most here expect something for little effort or even none at all.

 

So again thanks gentlemen.  My forum attitude and behavior will reflect this knowledge and like Hyman Roth I take care of my friends (Godfather 2 reference).

 

Sincerely,

 

Bill Walker

Link to comment
  • 2 weeks later...

I'm wondering recycle bin is working properly when I'm using Windows to access the shares but does not when using Linux.

Any issues known? Do I have to make a special config (e.g. special SMB-version for that?

Does not work means, there is no action at all. The .Recycle.Bin directory is not created, no files are moved. during deletion.

The shares are connected as CIFS-fstype, so should be the same SAMBA-connection as from Windows, right?

If there is already any described issue, shame on me that I've not found it. Then just be clement.

Best regards and thanks in advance for any help,

Marcus

Link to comment
3 hours ago, yaku said:

The shares are connected as CIFS-fstype, so should be the same SAMBA-connection as from Windows, right?

Not really.  The files have to be deleted with a SMB client like Windows.  Deleting them with Linux won't save them in the recycle bin.

Link to comment

Hi dlandon,

sorry to ask back, but where is the difference?

Thought, 'til now, CIFS/ SMB is quite the same.

How is detected by Unraid that the requesting client is Linux, not Windows? How and why is Unraid handling this request?

Is there any way, e.g. using a different way for connecting to the share, to get it work?

Best regards, Marcus

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.