Page 1 of 1

More efficient checking for empty subfolders?

PostPosted: Sun Jun 17, 2012 8:01 pm
by nriley
Hi,

I created a rule which works, but it seems Hazel has to check it very frequently.

Image

Inside the Library/Scans Completed folder, there are a few folders. I want the rule to trigger when all of these folders have remained empty for several minutes.

The log shows that Hazel ends up checking the folder every few seconds, and it's affected by other subfolders than "Scans Completed".

2012-06-17 19:39:44.542 hazelworker[9255] Sending metrics to scheduler. Next scheduled run: 5828963-12-19 19:00:00.000
2012-06-17 19:39:44.782 hazelworker[9256] File Preferences is busy. Skipping for now.
2012-06-17 19:39:46.810 hazelworker[9256] File Preferences is busy. Skipping for now.
2012-06-17 19:39:48.837 hazelworker[9256] Sending metrics to scheduler. Next scheduled run: 2012-06-17 19:44:43.000
2012-06-17 19:39:48.888 hazelworker[9263] Processing folder Library
2012-06-17 19:39:50.914 hazelworker[9263] Sending metrics to scheduler. Next scheduled run: 2012-06-17 19:44:43.000
2012-06-17 19:39:50.963 hazelworker[9264] Processing folder Library

Short of moving my folder to somewhere else other than the Library folderĀ (I've already had to nest it more deeply than originally desired) is there another way I can stop Hazel from checking so frequently?

Thanks!

Re: More efficient checking for empty subfolders?

PostPosted: Tue Jun 19, 2012 4:07 pm
by Mr_Noodle
I believe the reason it's busy is because there are file events constantly happening under the folder you are checking. For a rule like this, it has to work this way as otherwise, how would Hazel know that the the folders are all of a sudden empty? Any change in the filesystem below that point has to be checked to see if it changed things to make this condition true or false.

Re: More efficient checking for empty subfolders?

PostPosted: Sun Jul 08, 2012 7:54 pm
by nriley
I understand what you're saying, but the basic issue is that Hazel is triggering on changes in folder A when all I'm interested in is folder A/B. I couldn't figure out a way to write this rule (if it was possible) such that Hazel ignores the rest of folder A.

That said, the scanning doesn't seem to overwhelm the Mac, it just generates a lot of log output.

Re: More efficient checking for empty subfolders?

PostPosted: Sun Jul 08, 2012 10:02 pm
by a_freyer
nriley wrote:I understand what you're saying, but the basic issue is that Hazel is triggering on changes in folder A when all I'm interested in is folder A/B. I couldn't figure out a way to write this rule (if it was possible) such that Hazel ignores the rest of folder A.

That said, the scanning doesn't seem to overwhelm the Mac, it just generates a lot of log output.


You're monitoring the ~/Library/ directory, so your rule is going to be triggered dozens of times a minute, if not more often. I'd suggest moving the Scans Completed out of the Library.