Date Modified In Last Five Minutes Broken?

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

Moderator: Mr_Noodle

Date Modified In Last Five Minutes Broken? Tue Aug 11, 2009 9:55 am • by grovberg
I'm having Hazel process some video automatically after it's captured. To stop it from trying to grab the file mid-record, I've got the rule set up to run if the Date Last Modified is not in the last 5 minutes. It seems to work just fine, but I noticed that a message from Hazel shows up in the console almost immediately after the file is created where it says the rule is matched, but that it's skipping it because the file is busy.

So I guess my question is why the Date Last Modified property isn't working? I understand that what I see in Get Info isn't exactly what Hazel sees, but it's running before the file is even five minutes old. Or is this working as expected, and Hazel marks the file as "Busy" until the five minutes are up?

Also, once a file is marked as "Busy" and skipped, how long is it before Hazel will try again?

Thanks once again for such a great product. I'm always baffled by how useful it is.
grovberg
 
Posts: 17
Joined: Thu Nov 30, 2006 3:44 pm

The busy message indicates the file is being skipped over. It is detecting that the other program is still writing to it so until that program relinquishes its lock, Hazel will not do any rule matching on it. It's the expected behavior.

Hazel runs periodically so it might take a few minutes after the file is "free" again for Hazel to notice. This will change when Hazel goes Leopard-only (3.0) as it will use the newer fsevents engine allowing it to get more changes as they happen. But I'm getting ahead of myself here. For now, if it's possible to have the capture program trigger some sort of script, you can have it either "touch" the folder where the file is being saved or rename the file to trigger Hazel immediately. Let me know if you need help with it.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Thanks very much for your reply but I'm still not sure I understand why Hazel is activating in the first place. If the rule says to only match to a file when the date modified is not in the last five minutes, why is it matching on a file that was just created 30 seconds ago?

Since Hazel seems to be smart enough not to grab an active file, it's probably moot for this particular project, but it would be helpful to understand for future reference.

Thanks very much.
grovberg
 
Posts: 17
Joined: Thu Nov 30, 2006 3:44 pm

Hazel was activated because a file was added to the folder. The notification system in the OS doesn't know anything about rules. It just wakes up Hazel for certain changes. Hazel has to then check and see what happened and ascertain whether any conditions changed.

Also, in this case it's not matching the rule. Hazel is looking at the file and seeing it's busy before any rules are matched and skipping that phase. Hazel has to look at every file in the folder as it can't tell if it matches or not without looking.

One way to look at it is suppose you have a room with a bunch of boxes. Suppose you are told to throw away any box containing a blue object. You go through and check each one and throw out the appropriate ones and then leave. Now, you get a call saying that something's changed. You don't know what so you go back in and re-check everything. You can't just "know" that a box has a blue object now. You have to look. You also notice a new box sitting there. Some guy is still putting stuff in it (he left a note) so instead of checking it now, you come back later when he's finished. You don't actually check for a blue object because it's too early but you do have to check the box's status in the first place.

Hopefully that overly drawn out example clarifies things.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

I'm feeling absurdly stupid right now. My confusion was that when I saw the entry in the console, there was a different entry right above it for a file with a very similar name (the file names are long strings of numbers) that DID match a rule. So I was seeing "Rule Matched" and then the "Busy" message just underneath and I thought both messages were for the same file because I didn't read the filename carefully enough.

Thanks so much for such a thoughtful response, and I apologize for wasting your time.
grovberg
 
Posts: 17
Joined: Thu Nov 30, 2006 3:44 pm

Ah, that makes sense. I guess I should've had you post the logs up front. And no need to apologize. That's what I'm here for.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support