Sweeper repository request

It's removing the empty folders from the recycle bin, not empty folders elsewhere.

IIRC, prpr came up with a tidy-up utility to remove empty folders - could you be using that? I think it can also be done using sweeper rules.
 
IIRC, prpr came up with a tidy-up utility to remove empty folders - could you be using that?
It doesn't (didn't) remove things in the bin or in folder names beginning with 'special' characters, at least in the last released version.
 
Sorry BH I did not make my posting more clear.
To clarify I am only talking about the recycle bin. I set up a sweeper rule on the webif-autoshrink folder to remove all files in that folder. AF kindly gave me a command line to put in the crontabs/root file which caused the sweeper rule to be run. That command ran every 2 hours (ie, at 2, 4, 6, etc if the machine was on) and, initially, worked perfectly.
However when the undelete program ran on first boot of the day it removed all empty folders within the recycle bin. The consequence of this was that if the webif-autoshrink folder was empty it would also remove the webif-autoshrink folder and so the sweeper rule would 'disappear'.
 
However when the undelete program ran on first boot of the day it removed all empty folders within the recycle bin. The consequence of this was that if the webif-autoshrink folder was empty it would also remove the webif-autoshrink folder and so the sweeper rule would 'disappear'.
That shouldn't happen because the existence of the sweeper rule itself will prevent the directory from ever becoming empty - it's held in a file called .sweeper within the directory and empty_dustbin doesn't treat that specially.
 
That shouldn't happen because the existence of the sweeper rule itself will prevent the directory from ever becoming empty - it's held in a file called .sweeper within the directory and empty_dustbin doesn't treat that specially.
That's the problem. The sweeper rule is deleted just like any other file once it has aged sufficiently. The directory is then empty...
Code:
humax /mnt/hd2/My Video/[Deleted Items] # mkdir test
humax /mnt/hd2/My Video/[Deleted Items] # touch -d 201609010000 test/.sweeper
humax /mnt/hd2/My Video/[Deleted Items] # touch -d 201609010000 test/
humax /mnt/hd2/My Video/[Deleted Items] # /mod/sbin/empty_dustbin
Emptying dustbin at Mon Sep 19 12:20:45 BST 2016
Dustbin: /mnt/hd2/My Video/[Deleted Items]
Processing dustbin... (2 - 10,20,40,60,80,100,120)
Keeping deleted files for 2 days.
./test/.sweeper
1 = 10, 2 = 20, 3 = 40, 4 = 60, 5 = 80, 6 = 100, 7 = 120,
Free disk space: 177.77 GiB
Removing empty directories...
./test
Looking for orphaned HMT files.
======================================================================
Why is this in twice?
Code:
echo "Removing empty directories..."
find . -type d -exec rmdir {} \; -print 2>>/dev/null
find . -type d -exec rmdir {} \; -print 2>>/dev/null
 
Last edited:
That's the problem. The sweeper rule is deleted just like any other file once it has aged sufficiently. The directory is then empty...

Aha! Right, the cron command could be updated like this to avoid that problem:

Code:
0 */2 * * * touch "/media/My Video/[Deleted Items]/webif_autoshrink/.sweeper" && /mod/webif/plugin/sweeper/test "/media/My Video/[Deleted Items]/webif_autoshrink"

Why is this in twice?

The first run only removes empty directories which have no sub-directories. Two runs removes more empty directories as it will remove those at the end of the tree and those one level back up.
 
Because of problems with failed recordings, I swapped out my main box (another story).

I have just got round to reinstating the sweeper rule in the [Deleted Items] folder, and it appears to no longer be working recursively (if indeed it ever did). I amended the cronfile per post 28.

# expire
age 120 action delete

I am using the Beta webif 1.4.0 and updated sweeper package.
 
Back
Top