Recycle Bin (vfs recycle) for SMB Shares


dlandon

Recommended Posts

  • 2 weeks later...
On 3/15/2022 at 12:03 AM, dlandon said:

Set up a User Script to run on a cron for the time you want and run this command:

/usr/local/emhttp/plugins/recycle.bin/scripts/rc.recycle.bin cron &> /dev/null

 

i made a user script on 22:50 and its not working , i mean the script is runned by log but not delete old files only working when im running the script from user scipt menu in settings by manual pressing run script or run in backround.

 

Maybe you can help on it ?

if im not tuching/changing the permission option, its by default 0777 right?

image.thumb.png.c80dce71874249b99e44f0a33254e221.pngimage.thumb.png.0af0c7c4c679a3a5bf705167ad4043d8.png

 

Link to comment
1 hour ago, Masterwishx said:

i made a user script on 22:50 and its not working , i mean the script is runned by log but not delete old files only working when im running the script from user scipt menu in settings by manual pressing run script or run in backround.

Sounds like the User Script cron is not set up right.

Link to comment
47 minutes ago, Masterwishx said:

 

 

Strange i can see its running on log ,but folders in /mnt/RecycleBin/User Shares/my share1/Directory1 is still exist ... 

 

image.thumb.png.acec982ed9f6275b8be788a1ad56f261.png

 

log2.thumb.jpg.1233541fb93266737d3382228429336f.jpg

 

 

image.thumb.png.6e47a6372d29978d0235567cee7c4b7a.png

The recycle bin files are not aged by last modified (mtime).  They are aged by the atime.

Link to comment
7 hours ago, dlandon said:

The recycle bin files are not aged by last modified (mtime).  They are aged by the atime.

 

OK Thanks i got it , then i checked by stat command i can see same time of atime and mtime ...

we talking about folders in /mnt/RecycleBin/User Shares/my share1/Directory lvl1 , 

like  /mnt/RecycleBin/User Shares/my share1/Directory lvl1/Directory lvl2_1

       /mnt/RecycleBin/User Shares/my share1/Directory lvl1/Directory lvl2_2

       /mnt/RecycleBin/User Shares/my share1/Directory lvl1/Directory lvl2_3                       

 

Also strange that they deleting from manual script run , checkd also auto run in 3:00 also not delete the directorys 

 

image.png.aa547289b0e6dc825dcf9c281be6dffa.png

Link to comment
5 hours ago, Masterwishx said:

 

OK Thanks i got it , then i checked by stat command i can see same time of atime and mtime ...

we talking about folders in /mnt/RecycleBin/User Shares/my share1/Directory lvl1 , 

like  /mnt/RecycleBin/User Shares/my share1/Directory lvl1/Directory lvl2_1

       /mnt/RecycleBin/User Shares/my share1/Directory lvl1/Directory lvl2_2

       /mnt/RecycleBin/User Shares/my share1/Directory lvl1/Directory lvl2_3                       

 

Also strange that they deleting from manual script run , checkd also auto run in 3:00 also not delete the directorys 

 

image.png.aa547289b0e6dc825dcf9c281be6dffa.png

Looking into this.

  • Thanks 1
Link to comment
4 hours ago, Masterwishx said:

 

Today checked , and its deleted ...

the plugin check folders aged by the atime in smb share only Directory lvl1 or also Directory lvl2 ?

example /mnt/RecycleBin/User Shares/my share1/Directory lvl1/Directory lvl2_1

 

The Recycle Bin plugin uses the following command to find aged files:

find /mnt/RecycleBin/User\ Shares/*/* -type f -atime +4

Run this command and see what comes up as aged files.  These are the files that are deleted.  

 

I'm not seeing anything yet, but I'm still checking.

  • Like 1
Link to comment
30 minutes ago, dlandon said:

The Recycle Bin plugin uses the following command to find aged files:

find /mnt/RecycleBin/User\ Shares/*/* -type f -atime +4

Run this command and see what comes up as aged files.  These are the files that are deleted.  

 

So its two levels of share folders is checked ...

Strange but Somehow yesterday almost all folders deleted by the user script in 22:50 (but cant see what files is deleted in the log of script ) only one folder is avalible and its all files is listed after running your posted  (find ..... ) command and its by stat command:

 

image.png.3d0fe21459c7aa4ca46d60b55fc56a81.png

 

 

31 minutes ago, dlandon said:

I'm not seeing anything yet, but I'm still checking.

Thanks

Link to comment
1 hour ago, Masterwishx said:

(but cant see what files is deleted in the log of script )

The log of deleted files are files deleted in the shares, not files deleted from the Recycle.Bin folder by the plugin command.

 

I am testing one thing I don't like in the script, but I'm not sure it is affecting the removal of aged files.

 

The aged files are determined by the 'find' command, not what 'stat' shows.  The age days of 4 would I think be files that are over 4 days old, not exactly 4 days old.

 

I think you might be over analyzing this.

  • Like 1
Link to comment
28 minutes ago, dlandon said:

The aged files are determined by the 'find' command, not what 'stat' shows.  The age days of 4 would I think be files that are over 4 days old, not exactly 4 days old.

 

i checked by find command you posted befor stat command , for now the files i have in folders mostly same date becose of downloaded from torrent :) and it should be deleted on next day of age by plugin i think (for me on 5th day)

 

34 minutes ago, dlandon said:

The log of deleted files are files deleted in the shares, not files deleted from the Recycle.Bin folder by the plugin command.

 

Sorry, im not fully explained i meaned the script in user script log , but i understand that no log of deleted files on

rc.recycle.bin cron 

 

32 minutes ago, dlandon said:

I think you might be over analyzing this.

 

Like i said the folders deleted yesterday but its some days after 4 days and befor also some folders not deleted in time, only after manual remove.

some time folders take a lot of HDD space but not a problem if it delete in the end after some days after 4 days ,but wanted to know maybe i have a special problem somewhere to make it delete on next day after atime.

 

also wanted to ask you wrote we should exclude appdata and system from Recycle.Bin , is it still actual ?

 

Link to comment
On 4/2/2022 at 12:01 PM, Masterwishx said:

also wanted to ask you wrote we should exclude appdata and system from Recycle.Bin , is it still actual ?

It's a suggestion, not a requirement.  There's really no reason to use the recycle bin on those shares because they are not user shares.

 

I ran a test last night on the latest release of the plugin and it didn't delete the aged files.  I'm testing again tonight with a change I made that I believe was causing the issue.  It seems to be intermittent, so I'll be running my tests for several nights to be sure I've in fact got it.

  • Thanks 1
Link to comment
6 hours ago, dlandon said:

It's a suggestion, not a requirement.  There's really no reason to use the recycle bin on those shares because they are not user shares.

OK, Thanks

 

6 hours ago, dlandon said:

I'm testing again tonight with a change I made that I believe was causing the issue

 

Thanks for your time to solving this issue,  in my case its deleted after all and now its empty but after some days after (atime + next day) , will be cool if you will fix it .

Thanks again

Link to comment
On 4/4/2022 at 2:10 AM, Masterwishx said:

Thanks for your time to solving this issue,  in my case its deleted after all and now its empty but after some days after (atime + next day) , will be cool if you will fix it .

It doesn't appear that there is anything for me to fix here.  You need to understand how the age days work.  In your case, aging files 4 days it is actually aging files older that 4*24 hours ago and not 4 calendar days ago.  If the cron runs at 3:00 AM, any files older that 4*24 hours ago will be removed.  If there is a file that was deleted 4 days ago at 3:30 AM, it would not be aged at 3:00 AM because it is less that 4*24 hours ago, even though it was deleted 4 calendar days ago.

 

If you want better granularity, then run the cron every hour.  This will remove any files older that 4*24 hours ago every hour.

  • Thanks 1
Link to comment
1 minute ago, dlandon said:

4*24 hours ago will be removed

 

you right , so when i checked i was talking about next day after 4*24  --> 5*24 atime of files  but somehow sometimes its not deleting at all after 4*24hours when auto user script in 5th day 22:50 or 3:00 , its  after 4d+24h + 1-2-3-4 days , so anyway its deleting at the end and its NOT a Big problem for me at all.

 

but i will check it again any way

 

2 minutes ago, dlandon said:

It doesn't appear that there is anything for me to fix here.

 

i wrote to fix becouse you said you founded somethink that might couse the issue maybe and checking it ...

 

Thanks

 

 

 

Link to comment

I am having an issue where deleted files are not making the UI show any files to be deleted. Just like this person. What is the fix to make this work again?

On 3/21/2022 at 4:32 PM, starbetrayer said:

Here is what I see.

 

I tried to restart the plugin and refresh with no effect, it is not "seeing" the files and folders in the respective disk folder .Recycle.Bin

 

image.thumb.png.a48946ba472b7672e6a98d9b7d485817.pngimage.png.47f9b579c7095d575bdd7ae4ea0248cd.png

 

Link to comment

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.