Hazel runs rules every few seconds

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

Moderator: Mr_Noodle

Hazel runs rules every few seconds Tue Dec 17, 2013 2:06 pm • by fschoenm
I have the following rules set up to clean my log file folder regularly:

ImageImageImage

The rules seem to work but I see in my Console.app that Hazel scans the folders every few seconds (see below). I don't know exactly what it's triggered by but perhaps everytime a log file is changed – which in this case would probably be triggered by Hazel itself when it's updating its log.

Well, I don't want Hazel to spam its log file and probably letting my disk never sleep. What's the best way to scan the folder less often? For example I'd like to not run the rules if they already have been run in the last X hours or maybe only once a day.

Code: Select all
2013-12-17 18:59:52.867 hazelworker[3255] Processing folder Logs
2013-12-17 18:59:52.867 hazelworker[3255] DEBUG: Initialized
2013-12-17 18:59:52.867 hazelworker[3255] DEBUG: Pausing to wait for things to settle down.
2013-12-17 18:59:54.922 hazelworker[3255] DEBUG: Processing directories: (
    "/Users/***/Library/Logs"
)
2013-12-17 18:59:54.937 hazelworker[3255] DEBUG: About to process directory /Users/***/Library/Logs
2013-12-17 18:59:54.942 hazelworker[3255] DEBUG: Received file event: {
    date = "2013-12-17 17:59:52 +0000";
    path = "<ComNoodlesoft_NoodlePathSet: 0x7fc18361a5d0> - (\n    \"/Users/***/Library/Logs/Hazel\"\n)";
}
fschoenm
 
Posts: 4
Joined: Thu Feb 14, 2013 11:11 am

Re: Hazel runs rules every few seconds Tue Dec 17, 2013 3:03 pm • by Mr_Noodle
You should not be using this on Hazel's logs as it will create a loop. If there is file activity going on, though, it won't stop triggering Hazel as Hazel needs to wake up to see what happened. So even though you can minimize what Hazel does while it's running, because of all the log behavior constantly happening, Hazel will still continue to be triggered.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Hazel runs rules every few seconds Thu Dec 19, 2013 4:16 pm • by fschoenm
I understand, that's why I want to run the rules for example only once a day. Is this possible with a "Current time" condition? Do I need to add such a condition to all my rules for this folder? And what happens if my Mac is not running at the specified time? Is the rule execution then postponed to when it is next awake or do I have to wait until the condition matches again?
fschoenm
 
Posts: 4
Joined: Thu Feb 14, 2013 11:11 am

Re: Hazel runs rules every few seconds Thu Dec 19, 2013 5:36 pm • by Mr_Noodle
Again, just want to state that no matter what conditions you add, Hazel will trigger after any file events. Whether any rules match is a separate issue.

As for current time, it will match only around that time. If it's not running during that time, it won't match again until that time comes around again. You can also add a condition like "Date last matched is not in the last 1 day" which won't match more than once a day but the exact time that happens will vary (and probably drift around a bit).
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support