Jump to content
Koperfild

Samba Recycle Bin with VFS_Recycle

182 posts in this topic Last Reply

Recommended Posts

Both Recycle Bin and vfs_recycle are in /usr/local/emhttp/plugins/.  When you say "Utilities", do you mean a directory with that name?  Sorry for being so thick.

Share this post


Link to post

Sorry for taking a bit long to respond

 

cd /usr/local/emhttp/plugins

cd vfs_recycle/

ls -l

 

total 32
-rw-rw-rw- 1 root root  460 Apr  5 17:08 device_status.png
drwxrwx--- 2 root root   80 Apr  5 17:08 event/
-rw-rw-rw- 1 root root  778 Apr  5 17:08 information.png
-rw-rw-rw- 1 root root  607 Apr  5 17:08 new_config.png
-rw-rw-rw- 1 root root 3520 Apr  5 17:08 vfs_empty.png
-rw-rw-rw- 1 root root 3808 Apr  5 17:08 vfs_full.png
-rw-rw-rw- 1 root root 5638 Apr  5 17:08 vfs_recycle.page
-rw-rw-rw- 1 root root 2488 Apr  5 17:08 vfs_recycle_icon.png

 

nano vfs_recycle.page

 

Menu="Utilities"
Icon="vfs_recycle_icon.png"
Version="2015.04.01"
Type="php"
Title="Recycle Bin"
---

<?PHP 

 

Menu option is where you specify where it will shows up. It is supposed to have couple of setting, start/stop, empty the recycle bin, etc

 

Edit: I just noticed this section is added by Dynamix Plugins! You might have the install one of the plugins I have in the screenshot I joined or changing the category to something else to have it showing up.

 

Try changing it to Menu="NetworkServices".

screenshot.jpg.28703b7db9934bf778b6983330db9e07.jpg

Share this post


Link to post

No need to apologize, I appreciate your help with this.  I tried your suggestions and it seems to be working fine!  Thanks very much. 

 

The only "problem" I had was accessing the recycle bin in windows explorer.  Keeps asking for username/password. 

 

After doing a more thorough check, all is not well.  The folders that are deleted are saved in the recycle bin, but, not the files.  I seem to remember having this problem before.  :(

Share this post


Link to post

This depend of what you specify in your smb-extra.conf

 

Here's what inside mine:

#vfs_recycle_start
#Recycle bin share
[RecycleBin]
path = /mnt/user/.Recycle.Bin
read only = No

#vfs config
# Documentation http://www.samba.org/samba/docs/man/manpages-3/smb.conf.5.html
# Forum topic http://lime-technology.com/forum/index.php?topic=5446.0
# %S Samba share name (which in unRaid equals the user share name), eg. Storage
# %P User share full path, eg /mnt/user/Storage
# %u Username of the current service, if any
# To apply changes execute: /etc/rc.d/rc.samba restart
# If the single custom bin solution is chosen, create the dir manually, and grant it g+rwx permissions

[global]
vfs objects = recycle
   recycle:repository = /mnt/user/.Recycle.Bin/%u/%P
        recycle:keeptree = Yes
        recycle:touch = Yes
   recycle:touch_mtime = Yes
        recycle:versions = Yes
        recycle:exclude = *.tmp   
        recycle:exclude_dir = .Recycle.Bin
acl allow execute always = yes
#vfs_recycle_end

 

You might want to check this: https://www.samba.org/samba/docs/man/manpages-3/smb.conf.5.html

Share this post


Link to post

Tried using your conf file and still the same.  Folders but no files in recycle bin.  Maybe time to just give up on this. :(

Share this post


Link to post

One thing to add, if you can't access the recycle bin share from windows, you need to add the following line (assuming you don't use user level security) to the Recycle bin share section at the top of config/plugins/vfs_recycle/config/smb-extra.conf file.

 

guest ok = yes

Share this post


Link to post

I'm getting a different issue. My files are entering the BIN folder, but the plugin itself does not recognize this and offers no way to empty the recycle bin. That's not a huge deal, but it's a tad annoying. Additionally, I have several .fuse_hidden* files that just won't stay deleted, regardless of whether or not the plugin is running, so I have no idea what's happening there.

Share this post


Link to post

Wondering if anyone else is seeing this (I'm running 6b15).  On my console I keep getting these message (I'm thinking it may be because the plugin name is "Recycle Bin" with a space.  Any ideas how to fix this?  I assume I would just update the .plg to be something like Recycle_Bin

 

/usr/local/sbin/emhttp_event: line 74: [: /usr/local/emhttp/plugins/Recycle: binary operator expected

 

The line numbers listed are 61, 67, 74 and 80

Share this post


Link to post

I went in and edited the plg and took out the space, no more errors

 

Myk

Worked, Thanks!

Share this post


Link to post

I also had to make one additional change (besides removing the space), and that was a reference in the plg for the mount/umnount events from rc.vfs_recycle_plg to rc.vfs_plg to correct an error on startup.

Share this post


Link to post

I went in and edited the plg and took out the space, no more errors

 

Myk

Worked, Thanks!

What do you mean exactly with "took out space"? I see these messages on the console - does it cover these issues?

Share this post


Link to post

Yes, the fix covers that error.  If you open the .plg, you will see the Entity name on line 4 is "Recycle Bin"  In my case I changed it to "Recycle_Bin" and it got rid of that error message.  You can change it to anything you want, you just need to avoid the space since unraid sees the space as the end of a parameter, and so it thinks 2 parameters are being passed to it when it only expects one,.

Share this post


Link to post

Seems I must be the only one unable to get this working.  What plugin version are you installing?  When I delete something the files never make it to the recycle bin.  Would be nice if this was a default addon.  Thanks for any help.

Share this post


Link to post

Seems I must be the only one unable to get this working.  What plugin version are you installing?  When I delete something the files never make it to the recycle bin.  Would be nice if this was a default addon.  Thanks for any help.

 

I installed the version listed for 6.0 in this thread forked by Jencryzthers (which I modified slightly to remove some error messages that showed up on the console).  If you're on Unraid 5 you should be able to use the one developed by Influencer earlier in the thread.  It's just a matter of installing the .plg (either manually, or by putting it in /boot/extra and rebooting).  There is no GUI that will show the deleted files, they just show up in the RecycleBin share under the original path (so typically mnt/user), then enabling the plugin under settings.  The GUI is only used to specify how long the file is kept, to enable the plugin, and to enable a weekly cleanup.  The GUI portion is found under Settings/vfs_recycle.  To restore files, simply copy them from the RecycleBin directory back to their original location.

Share this post


Link to post

I think it's time for me to just give up on this.  When I delete files, the directory name shows in recycle bin, but, not the files.  Guess I'll just have to be extra careful.  ;D

Share this post


Link to post

...The GUI is only used to specify how long the file is kept, to enable the plugin, and to enable a weekly cleanup.  The GUI portion is found under Settings/vfs_recycle.  To restore files, simply copy them from the RecycleBin directory back to their original location.

I installed teh plugin, but I do not see the VFS Recycle GUI in settings. I used this back on v5 when Influencer first made it, but this is the first time I've loaded it up in v6. I am currently running UnRaid rc5. On the plugins page it is showing as installed. Any idea what may be wrong? It's late now and I've been up for almost 24 hours. I'll dig into the log tomorrow for clues.

 

EDIT:

Well after a 3rd reboot it is showing up, but oddly now I can not enable it and press Apply. The Apply button never becomes available to press. I am able to start/stop the Recycle Bin, but  I just can not change the setting and hit apply.

Share this post


Link to post

...The GUI is only used to specify how long the file is kept, to enable the plugin, and to enable a weekly cleanup.  The GUI portion is found under Settings/vfs_recycle.  To restore files, simply copy them from the RecycleBin directory back to their original location.

I installed teh plugin, but I do not see the VFS Recycle GUI in settings. I used this back on v5 when Influencer first made it, but this is the first time I've loaded it up in v6. I am currently running UnRaid rc5. On the plugins page it is showing as installed. Any idea what may be wrong? It's late now and I've been up for almost 24 hours. I'll dig into the log tomorrow for clues.

 

EDIT:

Well after a 3rd reboot it is showing up, but oddly now I can not enable it and press Apply. The Apply button never becomes available to press. I am able to start/stop the Recycle Bin, but  I just can not change the setting and hit apply.

 

Permissions issue?  I know when I first set it up, I couldn't get the config changes to apply, so I had to manually edit the config file to empty once per week, etc.

Share this post


Link to post

Dis you try it with crossrename?

#vfs_recycle_start
#Recycle bin share
[RecycleBin]
path = /mnt/user/.Recycle.Bin
read only = No

#vfs config
[global]
vfs objects = recycle crossrename
        recycle:repository = /mnt/user/.Recycle.Bin/%m/%P
        recycle:keeptree = Yes
        recycle:touch = Yes
        recycle:touch_mtime = Yes
        recycle:versions = Yes
        recycle:noversions = *.doc
        crossrename:sizelimit = 50000
recycle:exclude = *.tmp
       	recycle:exclude_dir = .Recycle.Bin
#vfs_recycle_end

I think it's time for me to just give up on this.  When I delete files, the directory name shows in recycle bin, but, not the files.  Guess I'll just have to be extra careful.  ;D

Share this post


Link to post

On 6.0.1 I'm getting this line under "recycle bin" and above status.

 

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(278) : eval()'d code on line 4

 

When you run it that disappears, but you can't modify an of the settings. :(

 

If there anyone that can take on this project?  Influencer is busy these days with family matters or I would ask him nicely to update it.

Share this post


Link to post

Started ok anyway and the error disappear and now showing as running.  I then stopped it again, and copied over the config file from my V5 version and restarted and it now has the settings I was using before  The apply button wasn't active so couldn't set my preferences.

 

It's working great, and picking up folders trees and files ok.  Hopefully someone can pick it up as a project and get rid of the errors.

Share this post


Link to post

Never done this before but I had a go at editing the errors in the plg on github and it didn't seem to work :(

 

I tried to change the links to the vfs recycle plg with the Recycle Bin's changed to Recycle_Bin and also the vfs_recycle_plg changed to vfs_plg.

 

All the errors on my systems have stopped since implementing these changes.  running V 6.0.1

Share this post


Link to post

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.