Rule used to work, but cannot get it working again

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

Moderator: Mr_Noodle

I hope you may be able to point out what I expect is a simple error in my logic, that is preventing me from getting an action to operate as expected. It is more frustrating because I have had the action working fine for a couple of years, but I recently tried simplifying the rule, which has broken it, and I cannot get back to a working state.

I have a folder containing six files. I wish to trigger a shell script daily at 1330. The script replaces the files with updated ones from AWS. The new files have the same names as the old ones, but different sizes and new last modified dates.

I started with the sole condition ‘Current time is 13:30 any day’. I noticed from the log that this was firing multiple times, presumably for each file in the folder (though never executing the action). Therefore I added a new first rule ‘Full name is [name of one of the files]’. This stopped the repeated firings, but did not cause the action to be executed. There was no trace in the log of anything happening at 1330.

I then presumed that Hazel was not recognising the nominated file as new, and was assuming it had matched it at some time in the past, and so was now ignoring it. I therefore added a third condition ‘Date last matched is not in the last six hours’. Still it did not work, with no trace of any activity at that time in the log (even with debug mode on).

Overall, what I find strangest is that the log is not showing any twitch of activity at 1330 each day.

The action that should be happening is:
- Run shell script [name of script]
- Continue matching rules

The Continue action is there because there is another similar rule later in the rule list, to run two R scripts on the data files. This is also failing but has a similar condition structure, so if I can fix the first rule then I will probably be able to fix the second.

Debugging to date

1 Hazel is running.
2 The folder is not paused in Hazel.
3 The rules are ticked to be active, and the one discussed here is the first listed rule.
4 When I run preview on the rule, it confirms that the file name I am asking it to match does trigger the rule. The Date last matched also gets a green tick. If I do the preview at exactly 1330 then even the time gets a green tick, and preview reports ‘rule matched’ (but nothing happens).
5 If I run the shell script manually, it runs fine with no errors.
6 The shell script has the permissions 755 (everyone can read and execute).
7 I have relinked the shell script to the action, in case there was some imperceptible discrepancy in file names.
8 The folder is in Dropbox, but I have other rules running successfully on adjacent Dropbox folders, so fact that it is on Dropbox seems unlikely to be a cause of the problem.
9 If I ‘Show in Finder’ on the folder in folder view, it shows me the correct folder, so I am asking it to operate on the folder I think I am.
10 I have re-read the Hazel manual.

MacOS 10.14.6, Hazel 4.4.2.

Any thoughts or suggestions appreciated.

Regards,

Paul Kelly
Paul Kelly
 
Posts: 1
Joined: Thu Dec 05, 2019 3:43 pm

Can you enable debug logging as described here: https://www.noodlesoft.com/kb/hazel-debug-mode/

After that, send me an excerpt of the logs at 13:30.
Mr_Noodle
Site Admin
 
Posts: 11250
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

I have had similar weird "rule used to work then didn't" happenings and I believe that sometimes Hazel or a MacOS update just breaks things. One time my rules just became corrupted for no obvious reason (they all looked correct) and the solution was to delete the rule and then recreate it. I also suspect that sometimes Hazel doesn't respect changes until after a reboot, although I have no firm evidence of this.

The reality is that rules that work, shouldn't just stop working. And if they do, there has to be a reason why!
sn00m
 
Posts: 12
Joined: Fri Dec 22, 2017 8:17 pm

Rule changes should go into effect on the next run of that folder. No reboot is needed unless there's a long-running process on that folder that won't quit, in which case, you have a different problem.

As usual, going through the troubleshooting guide should be the first step: https://www.noodlesoft.com/kb/hazel-tro ... ing-guide/
Mr_Noodle
Site Admin
 
Posts: 11250
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support

cron