most recent and least recent both say they're the same thing

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

I have a rule that always fails. It's supposed to move .zip archives to the trash once they are 30 days old, but to never move the most recent 5 archives. Thus there should always be at least 5 archives and there should never be anything older than 30 days in the folder. Currently there are 54 files in the directory, and 5 of them are older than 30 days.

The problem I see is that Hazel doesn't seem to care if a thing is least recent or most recent. that particular step fails (according to "Preview Rule") regardless of which way it is set.

Image

Here it is tested with the setting to "least recent" and it still fails.

Image

oddly, if it's set to "is among the", both most recent and lest recent pass.

Image

and

Image

So any ideas? what can I try next? How can a file in a folder with 54 items be the "most recent" and the "least recent" file at the same time? (btw, it doesn't matter which file, they all report the same way - at least the random smattering of them that I tested)

I use nearly the same rule in other folders, but with the 2nd Date Created omitted (the 30 day one) and the "date created not among the 5 most recent" rule works exactly perfectly. All of the folders where that one runs have exactly 5 .zip archives in them. So is the problem having two "date created" steps in one rule?

...as a long time user of Hazel, I'm sure I'm just missing something silly. any help or pointers will be greatly appreciated!

OS X Version 11.1 (Build 20C69)
Hazel Version 5.0.3 (Build 2094)
on a M1 Mac Mini
pumasalad
 
Posts: 9
Joined: Sat Oct 19, 2019 6:18 pm

Can you click on badge for that condition to see the date created? Note that it is not the same as the date modified.
Mr_Noodle
Site Admin
 
Posts: 11868
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

yes. it says "Date Created Nov 27, 2020 at 1:37pm.

Image

it still makes no logical sense to me that the same file is the "most recent" and the "least recent" in a list of 54 items.
pumasalad
 
Posts: 9
Joined: Sat Oct 19, 2019 6:18 pm

I understand that, but trying to pin down the conditions involved here. Do all of the other conditions (extension, tags, name) match all of the 54 files? If not, are there more than 5 files that match all the other conditions?
Mr_Noodle
Site Admin
 
Posts: 11868
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

yes, all have the same extension (.zip) and all have the exact same tag (it was placed there by a different Hazel rule).

Interestingly, today, the files dated 11-27 were handled by the rule. so the oldest files in the directory are now 11-28 according to the "date modified" column.

When I start previewing each individual file, all of the files older than 30 days fail the "date created is not among the 5 most recent" rule, but when I get to the files that are 30 days or younger (12-03-20 or newer), that rule passes (!) and the "Date created is not in the last 30 days" rule fails (as it should). I didn't check every file (there are 58 of them now) but I did check the oldest 10 and the newest 10 and a couple in the mid-section and all of them reacted the same way. dated 12/2 or earlier and they fail only the "not among the 5 most recent" rule, dated 12/3 or later and they fail only the 30 day rule.

It's quirky.

I'm comfortable sharing the logs if you would like to see them. I turned on "Debug Mode" and all the options a day or two ago.

I use Hazel to do a lot or archive management, and this is the first time in years that the logic has fought with me. :) It's a real head scratcher.

a little more background on this issue:

I have a parent folder named "Database Backups" with 16 folders in it - each one named for a specific filemaker database. Whenever one of those databases is opened or closed, it creates a backup file in it's specific folder. The rules are set for the parent folder, and then run recursively in all of the sub folders.

The rules are:
1. Archive the .fmp12 document 1 hour after it arrives in the folder
2. Delete .zip files that are not in the most recent 5
3. Delete any .zip files that are older than 30 days (but keep the most recent 5 regardless of age)
4. Run rules on sub folders too

There are no rules specifically on any of the sub folders except the one where I'm having trouble and those are:
1. add the tag "30 Day Backup Plan" to any archive
2. Delete .zip files that are older than 30 days (but keep the most recent 5 regardless of age)

I'm not sure why i have the duplicate rule in both places (#3 in the first set is the same as #2 in the second set), but it was probably me trying to debug this issue when it wasn't working.
pumasalad
 
Posts: 9
Joined: Sat Oct 19, 2019 6:18 pm

Today, with no prodding by me or any editing or even without opening the folder, all of the .zip files from 12/3 and before were moved into the trash. This includes files dated 11/28, 12/2 and 12/3, for a total of 11 files.

this is exactly the behavior I expect from the rule, except I would've liked to see the 11/28 files moved a couple of days ago and the 12/2 files moved yesterday.

So if I look at the files now, as of 1/4/2021, it looks like it's working perfectly. But we know it's not... :)

I'll keep an eye on it and report back. Maybe it was just a new change-of-year glitch (y2k+20 anyone?).
pumasalad
 
Posts: 9
Joined: Sat Oct 19, 2019 6:18 pm


Return to Support