Jump to content
dlandon

Recycle Bin (vfs recycle) for 6.3 and later versions

439 posts in this topic Last Reply

Recommended Posts

9 hours ago, MyKroFt said:

trying this again as you requested.

 

There is nothing in the deleted log section, no errors listed in syslog when I deleted a folder with aprox 20 files via a samba share, diags attached again

vlog.zip

Please post the following files.  You may want to PM these to me because they will have share information in them.

  • /boot/config/plugins/recycle.bin/recycle.bin.cfg
  • /boot/config/smb-extra.conf
  • /etc/samba/smb-shares.conf

Share this post


Link to post
7 hours ago, Mopar_Mudder said:

I just installed this for the first time as I just lost a bunch of files from an accidental delete, figure this would solve that in the future. I am on 6.3.5 and I can't get it to work. It is enabled and show . files is on. After deleting test files the recycle bin says empty still.

 

Not sure what logs need posting to help.

 

Well it just kinda worked, deleted 5 files and only 2 showed up in the recycle folder.

Some files will not be added to the recycle bin with certain file extensions or zero length files.  Give me some examples of files/file extensions that don't show up in the deleted files.

 

Please realize that when the recycle bin is started, it is up to Unraid to restart the samba service to enable the recycle bin.  It can take several minutes for that to happen.  Until samba is restarted to enable the recycle bins on the shares, deleting files will not show up in the recycle bin.

  • Upvote 1

Share this post


Link to post
1 hour ago, perfessor101 said:

 

I mentioned something a few months back about certain file extensions just disappearing on deletion and not being recycled. 

 

I was considering writing a script to generate all three letter file extensions and see how many got recycled ... but then I realized unRaid isn’t running on dos 3.0. 

Give me some examples of the file extensions that are not showing up in the recycle bin when deleted.

Share this post


Link to post
3 hours ago, dlandon said:

Some files will not be added to the recycle bin with certain file extensions or zero length files.  Give me some examples of files/file extensions that don't show up in the deleted files.

 

Please realize that when the recycle bin is started, it is up to Unraid to restart the samba service to enable the recycle bin.  It can take several minutes for that to happen.  Until samba is restarted to enable the recycle bins on the shares, deleting files will not show up in the recycle bin.

All the files were JPG but I think a couple might have had a "0" files size because they were corrupt and I got rid of them, maybe that caused the problem. I tried again this morning on another bunch of JPG files that have been on the server for along time and all 5 showed up in the bin after deleting. So I will do some more testing on it and see what happens.

Share this post


Link to post

Currently I can't get a recycle.bin working on either of my UnRaid arrays ... 6.6.0-rc3

 

wrote a script that generates a bunch of files with  single, double and triple character extensions (upper and lower case letters with numbers)  ... it generates about 242,234 files

four characters is over a million files ... that might take an hour or two to delete from Windows 7

 

Here's the script for the brave ... it's pretty bad ... took me 45 minutes of googling

 

When my arrays start co-operating again I'll give it another try

 

I put it on disk5 in my case under a directory called recycle.test and with a sub directory called test.directory

and hopefully makes a file named listing.before.delete.txt

 

After which one would then delete the generated files and do a new directory listing with ls -1a to a file called listing.after.delete.txt and then do a diff between them

 

Hopefully my variable names aren't too mangled


 

#!/bin/bash


dirroot=/mnt/disk5/recycle.test
dirtest=$dirroot/test.directory

for c1 in {A..Z} {a..z} {0..9}
do
     filename=1one
     extention=$c1
     printf "%s\n" "$dirtest/$filename.$extention"
     touch $dirtest/$filename.$extention
done

read -rsp $'1 - Press enter to continue...\n'

for c1 in {A..Z} {a..z} {0..9}
do
     for c2 in {A..Z} {a..z} {0..9}
     do
            filename=2two
            extention=$c1$c2
            printf "%s\n" "$dirtest/$filename.$extention"
            touch $dirtest/$filename.$extention
     done
done

read -rsp $'2 - Press enter to continue...\n'

for c1 in {A..Z} {a..z} {0..9}
do
     for c2 in {A..Z} {a..z} {0..9}
     do
         for c3 in {A..Z} {a..z} {0..9}
         do
            filename=3three
            extention=$c1$c2$c3
            printf "%s\n" "$dirtest/$filename.$extention"
            touch $dirtest/$filename.$extention
         done
     done
done

read -rsp $'3 - Press enter to continue...\n'

ls -1a $dirtest >$dirroot\listing.before.delete.txt

read -rsp $'Press enter to continue...\n'
read -rsp $'Press enter to continue...\n'
read -rsp $'Press enter to continue...\n'

 

Thanks for your time,

Bobby

Share this post


Link to post
21 minutes ago, perfessor101 said:

Currently I can't get a recycle.bin working on either of my UnRaid arrays ... 6.6.0-rc3

 

wrote a script that generates a bunch of files with  single, double and triple character extensions (upper and lower case letters with numbers)  ... it generates about 242,234 files

four characters is over a million files ... that might take an hour or two to delete from Windows 7

 

Here's the script for the brave ... it's pretty bad ... took me 45 minutes of googling

 

When my arrays start co-operating again I'll give it another try

 

I put it on disk5 in my case under a directory called recycle.test and with a sub directory called test.directory

and hopefully makes a file named listing.before.delete.txt

 

After which one would then delete the generated files and do a new directory listing with ls -1a to a file called listing.after.delete.txt and then do a diff between them

 

Hopefully my variable names aren't too mangled


 


#!/bin/bash


dirroot=/mnt/disk5/recycle.test
dirtest=$dirroot/test.directory

for c1 in {A..Z} {a..z} {0..9}
do
     filename=1one
     extention=$c1
     printf "%s\n" "$dirtest/$filename.$extention"
     touch $dirtest/$filename.$extention
done

read -rsp $'1 - Press enter to continue...\n'

for c1 in {A..Z} {a..z} {0..9}
do
     for c2 in {A..Z} {a..z} {0..9}
     do
            filename=2two
            extention=$c1$c2
            printf "%s\n" "$dirtest/$filename.$extention"
            touch $dirtest/$filename.$extention
     done
done

read -rsp $'2 - Press enter to continue...\n'

for c1 in {A..Z} {a..z} {0..9}
do
     for c2 in {A..Z} {a..z} {0..9}
     do
         for c3 in {A..Z} {a..z} {0..9}
         do
            filename=3three
            extention=$c1$c2$c3
            printf "%s\n" "$dirtest/$filename.$extention"
            touch $dirtest/$filename.$extention
         done
     done
done

read -rsp $'3 - Press enter to continue...\n'

ls -1a $dirtest >$dirroot\listing.before.delete.txt

read -rsp $'Press enter to continue...\n'
read -rsp $'Press enter to continue...\n'
read -rsp $'Press enter to continue...\n'

 

Thanks for your time,

Bobby

I'm not sure I follow what you are up to, but I don't intend to waste my time with this script.  What does this prove or disprove?

 

When you say the recycle bin is not working, what is not working?  If you are not getting any files to show up in the recycle bin, then there is a more basic issue.

 

Please post the following files.  You may want to PM these to me because they will have share information in them.

  • /boot/config/plugins/recycle.bin/recycle.bin.cfg
  • /boot/config/smb-extra.conf
  • /etc/samba/smb-shares.conf
  • Upvote 1

Share this post


Link to post

That script only produces 0-byte files. You need content in the files for the Recycle-Bin to function.

Share this post


Link to post
2 minutes ago, BRiT said:

That script only produces 0-byte files. You need content in the files for the Recycle-Bin to function.

Correct, zero byte files are not moved to the recycle bin when deleted.

 

Share this post


Link to post
13 hours ago, dlandon said:

Please post the following files.  You may want to PM these to me because they will have share information in them.

  • /boot/config/plugins/recycle.bin/recycle.bin.cfg
  • /boot/config/smb-extra.conf
  • /etc/samba/smb-shares.conf

 

PM sent

Thanks

Myk

 

Share this post


Link to post
19 minutes ago, MyKroFt said:

 

PM sent

Thanks

Myk

 

You have the recycle bin enabled on appdata, system, nextcloud, and temp shares.  You should exclude those.  Especially appdata and system.  I suspect there is so much samba activity on those shares the recycle bin can't keep up.  Try to limit the recycle bin to shares where you really need its capabilities.

Share this post


Link to post
26 minutes ago, dlandon said:

You have the recycle bin enabled on appdata, system, nextcloud, and temp shares.  You should exclude those.  Especially appdata and system.  I suspect there is so much samba activity on those shares the recycle bin can't keep up.  Try to limit the recycle bin to shares where you really need its capabilities.

ok, will do

 

Thanks for the direction

Share this post


Link to post

For those of you that cannot get the recycle bin to work, there is an issue right now that I see in 6.5 and 6.6 that keep the recycle bin from working properly.  It may be that this issue applies to 6.4 also.

 

It seems that some changes were made in Unraid along the line that prevent the recycle bin parameters from getting applied when changes are made in the plugin parameters.  The recycle bin will be applied when the array is started, but changes in the plugin parameters will not get applied from the plugin webpage.  For the moment, you will have to stop and restart the server to get the recycle bin parameter changes applied.  This also applies to starting and stopping the recycle bin from the webpage.  I will be working with LT on solving this issue.

Share this post


Link to post

I had a look for you...

 

Your plugin is using the event "svcs_restarting", but the event to be used is "svcs_restarted",

# svcs_restarted
#   Occurs during cmdStart execution.
#   Occurs as a result of changing/adding/deleting a share.
#   The network services are started and may be exporting different share(s).

I don't know (and didn't check) if the name has changed with 6.6

Share this post


Link to post

I've updated the plugin to deal with a long standing issue related to the recycle bin configuring samba correctly.  Once you update to the latest plugin version, you should restart the recycle bin and it should work properly from then on.

 

For those of you that have had trouble getting the recycle bin to work at all, try the latest version and let me know if it works for you.

  • Upvote 1

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now