Rule not running on file modification

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

Moderator: Mr_Noodle

Rule not running on file modification Thu Jul 10, 2025 4:23 am • by metaning
I'm trying to get Hazel to back up a file to another directory whenever that file is modified.

The rules are:

If ALL:
- Extension | is | .dnl
- Date Last Modified | is in the last | 5 | minutes

Do the following:
- Copy | to folder (my folder choice) | Options: Replace the existing file

If I do something in the app using this file, I can see the .dnl file's modified date is changed in Finder's get info, and I can see Hazel's log then runs this:

Code: Select all
2025-07-10 17:45:38.148 hazelworker[67864] Running worker (v5.3.4) for folder with identifier: 16777231-19563.
2025-07-10 17:45:38.149 hazelworker[67864] ###Arch: x86_64
2025-07-10 17:45:38.149 hazelworker[67864] ###main load address: 0x10091c000
2025-07-10 17:45:38.149 hazelworker[67864] ###Hazel Core load address: 0x100b2c000
2025-07-10 17:45:38.149 hazelworker[67864] ###Noodle load address: 0x100e34000
2025-07-10 17:45:38.149 hazelworker[67864] ###CK load address: 0x100a1a000
2025-07-10 17:45:38.165 hazelworker[67864] Processing folder Doughnut
2025-07-10 17:45:40.248 hazelworker[67864] Done processing folder Doughnut


But the file isn't moved, and it will stay unmoved until the rule passes the 5 minute timeout and the rule preview puts a red fail on the timing condition.

If I change something in the file again, and manually run the rule, it copies the file (and moves the old one to the trash if there's one there - an option to overwrite in place would be nice).

You can see in this log it appears to run, and do nothing immediately upon changing the file, then runs again when I manually run the rule, and copies the file.

Code: Select all
2025-07-10 18:16:02.050 hazelworker[68558] Running worker (v5.3.4) for folder with identifier: 16777231-19563.
2025-07-10 18:16:02.052 hazelworker[68558] ###Arch: x86_64
2025-07-10 18:16:02.052 hazelworker[68558] ###main load address: 0x10af2c000
2025-07-10 18:16:02.052 hazelworker[68558] ###Hazel Core load address: 0x10b13c000
2025-07-10 18:16:02.052 hazelworker[68558] ###Noodle load address: 0x10b444000
2025-07-10 18:16:02.052 hazelworker[68558] ###CK load address: 0x10b02a000
2025-07-10 18:16:02.069 hazelworker[68558] Processing folder Doughnut
2025-07-10 18:16:04.153 hazelworker[68558] Done processing folder Doughnut
2025-07-10 18:16:10.225 hazelworker[68559] Running worker (v5.3.4) for folder with identifier: 16777231-19563.
2025-07-10 18:16:10.226 hazelworker[68559] ###Arch: x86_64
2025-07-10 18:16:10.226 hazelworker[68559] ###main load address: 0x1055cc000
2025-07-10 18:16:10.226 hazelworker[68559] ###Hazel Core load address: 0x1057dc000
2025-07-10 18:16:10.227 hazelworker[68559] ###Noodle load address: 0x105ae4000
2025-07-10 18:16:10.227 hazelworker[68559] ###CK load address: 0x1056ca000
2025-07-10 18:16:10.243 hazelworker[68559] Processing folder Doughnut (forced)
2025-07-10 18:16:12.321 hazelworker[68559] Doughnut Library.dnl: Rule Library file Archiver matched.
2025-07-10 18:16:12.321 hazelworker[68559] [File Event] File copied: Doughnut Library.dnl copied from folder /[removed]/Doughnut to folder /[removed]/Doughnut Library Backup.
2025-07-10 18:16:14.418 hazelworker[68559] Done processing folder Doughnut


Am I missing something? My other automatic rules on 5 minute timeouts for files added seem to be working ok.
metaning
 
Posts: 14
Joined: Fri Dec 16, 2022 7:21 am

Re: Rule not running on file modification Thu Jul 10, 2025 5:02 am • by metaning
I changed the Do rule to Sync, which solves the putting copies in the bin issue, but it's still not auto running:

Code: Select all
2025-07-10 18:58:30.218 hazelworker[69594] Running worker (v5.3.4) for folder with identifier: 16777231-19563.
2025-07-10 18:58:30.220 hazelworker[69594] ###Arch: x86_64
2025-07-10 18:58:30.220 hazelworker[69594] ###main load address: 0x100494000
2025-07-10 18:58:30.220 hazelworker[69594] ###Hazel Core load address: 0x1006a4000
2025-07-10 18:58:30.220 hazelworker[69594] ###Noodle load address: 0x1009ac000
2025-07-10 18:58:30.220 hazelworker[69594] ###CK load address: 0x100592000
2025-07-10 18:58:30.236 hazelworker[69594] Processing folder Doughnut
2025-07-10 18:58:32.319 hazelworker[69594] Done processing folder Doughnut


It does the file sync if I manually run the rule, though.
metaning
 
Posts: 14
Joined: Fri Dec 16, 2022 7:21 am

Re: Rule not running on file modification Thu Jul 10, 2025 5:24 am • by metaning
OK, I removed the 5 minute timer, and it worked once, but then stopped working with the same symptoms.

Also, it's filling the bin with the old versions of the file / folder, which isn't really tenable as a solution. Is there any way to get Hazel to just overwrite things in place without putting copies in the trash?
metaning
 
Posts: 14
Joined: Fri Dec 16, 2022 7:21 am

Re: Rule not running on file modification Thu Jul 10, 2025 9:19 am • by Mr_Noodle
Can you go through the troubleshooting guide here? https://www.noodlesoft.com/kb/hazel-tro ... ing-guide/

Please do all tests listed there and report back with the results.
Mr_Noodle
Site Admin
 
Posts: 11945
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Rule not running on file modification Sat Jul 12, 2025 7:06 am • by metaning
Mr_Noodle wrote:Can you go through the troubleshooting guide here? https://www.noodlesoft.com/kb/hazel-tro ... ing-guide/

Please do all tests listed there and report back with the results.


I recreated the rule from scratch, after upgrading from Hazel 5 to 6.

Creating the rule:

If ALL:
- Extension IS .dnl

Do:
SYNC into folder (a subfolder)

Rule Preview shows green tick.

Alter the file by performing an action in the application whose library file I'm syncing.

Finder shows the File modification date as 20:47

Hazel's Log does the following:

Code: Select all
2025-07-12 20:47:16.523 hazelworker[24430] Running worker (v6.0.4) for folder with identifier: 16777231-150835.
2025-07-12 20:47:16.525 hazelworker[24430] ###Arch: x86_64
2025-07-12 20:47:16.525 hazelworker[24430] ###main load address: 0x10e480000
2025-07-12 20:47:16.525 hazelworker[24430] ###Hazel Core load address: 0x10e691000
2025-07-12 20:47:16.525 hazelworker[24430] ###Noodle load address: 0x10e99f000
2025-07-12 20:47:16.525 hazelworker[24430] ###CK load address: 0x10e577000
2025-07-12 20:47:16.538 hazelworker[24430] Processing folder Doughnut Library Backup
2025-07-12 20:47:18.616 hazelworker[24430] Done processing folder Doughnut Library Backup


Hazel's Rule Status Info for the file shows:
- Last modified: 8:47pm
- Last matched: 8:44pm

Ahh - this might be it:

- Content modified: 8:18pm

I wonder if what's happening is that Doughnut modifies its library file when you mark a file as played or unplayed in a way that Finder shows as a modification event, but which Hazel doesn't consider a change to the actual content of the file?

Obviously, that would be a problem because recording these modification events is half the purpose of the file.


FWIW I did come up with a different solution to the problem (wanting Time Machine to back up this library, but not the podcast files themselves, and not wanting to have to put an exclusion into TM's settings for every podcast folder in Doughnut's directory - which is very flat; the library file, and a folder for each show), which was to move the Library file to somewhere that was backed up with TM, and then symlink the library back to Doughnut's directory (it wouldn't recognise an alias). So I don't actually need to use Hazel to solve this any more. Still, it's an interesting conundrum.
metaning
 
Posts: 14
Joined: Fri Dec 16, 2022 7:21 am


Return to Support