only one action runs

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

Moderator: Mr_Noodle

only one action runs Wed Sep 05, 2018 2:14 am • by joh
hello newb here please excuse!
would love some help on this
probably overlooking something?

the rule works because if i run it manually it works as expected
but it only the new file part works in the background.

WHAT I HAVE

the rule that is meant to copy any new files in folderA to folderB
AND
update any files that have changed in folderA in folderB

it copies new files fine
but it only updates existing changed files if i run the rule manually

the rule is

if any
date last modified did change OR if date created is after specific date 04-09-2018
copy to folderB
options : replace the exisiting file

PLEASE HELP
this is driving me crazy.
joh
 
Posts: 3
Joined: Wed Sep 05, 2018 1:53 am

Re: only one action runs Wed Sep 05, 2018 11:33 am • by Mr_Noodle
It's usually better to use "Date last modified is after date last matched" to catch changes. If it still doesn't work, then check the logs. Go to the "Info" section and click "View Log". Feel free to post/email what you find there.
Mr_Noodle
Site Admin
 
Posts: 11240
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: only one action runs Wed Sep 05, 2018 2:14 pm • by joh
Mr_Noodle wrote:It's usually better to use "Date last modified is after date last matched" to catch changes. If it still doesn't work, then check the logs. Go to the "Info" section and click "View Log". Feel free to post/email what you find there.


thanks. ok changed it to "Date last modified is after date last matched" but the problem is the same : it doesn't change the file unless i run it manually.

is this the correct bit of the log?

log:
) for stream at path: /Users/jk/Desktop/syncA
2018-09-05 20:05:30.992 HazelHelper[534] DEBUG: Thread 0x604000069000: Run worker for folder: /Users/jk/Desktop/syncA
2018-09-05 20:05:30.992 HazelHelper[534] DEBUG: Task already running for folder: /Users/jk/Desktop/syncA
2018-09-05 20:05:32.155 hazelworker[3269] DEBUG: Processing directories: (
"/Users/jk/Desktop/syncA"
)
2018-09-05 20:05:32.159 HazelHelper[534] DEBUG: Checking events for path /Users/jk/Desktop/syncA, folder syncA
2018-09-05 20:05:32.160 hazelworker[3269] DEBUG: Received file event: {
date = "2018-09-05 18:05:30 +0000";
path = "<ComNoodlesoft_NoodlePathSet: 0x7f8cbb70b760> - (\n \"/Users/jk/Desktop/syncA\"\n)";
}
2018-09-05 20:05:32.160 hazelworker[3269] DEBUG: About to process directory /Users/jk/Desktop/syncA
2018-09-05 20:05:32.165 hazelworker[3269] DEBUG: .DS_Store: File is hidden/invisible. Skipping.
2018-09-05 20:05:32.167 hazelworker[3269] DEBUG: .com.greenworldsoft.syncfolderspro: File is hidden/invisible. Skipping.
2018-09-05 20:05:32.173 hazelworker[3269] DEBUG: z1.txt: Rule signature matched for rule copy file if did change. Not executing actions.
2018-09-05 20:05:32.173 hazelworker[3269] DEBUG: Writing out DB file: /Users/jk/Desktop/syncA
2018-09-05 20:05:32.190 hazelworker[3269] DEBUG: Directory /Users/jk/Desktop/syncA processed in 0.029641 seconds
2018-09-05 20:05:32.191 HazelHelper[534] DEBUG: Checking events for path /Users/jk/Desktop/syncA, folder syncA
2018-09-05 20:05:32.192 hazelworker[3269] DEBUG: Sending metrics to scheduler. Next scheduled run:
2018-09-05 20:05:32.193 HazelHelper[534] DEBUG: Received metrics for folder /Users/jk/Desktop/syncA: {
directoryDepth = 0;
requestedSchedulingTime = "";
triggerPaths = "<ComNoodlesoft_NoodlePathSet: 0x60000003eb80> - (\n)";
unavailablePaths = "{(\n)}";
}
2018-09-05 20:05:32.193 HazelHelper[534] DEBUG: Timer scheduled for folder /Users/jk/Desktop/syncA at
2018-09-05 20:05:32.194 hazelworker[3269] Done processing folder syncA
2018-09-05 20:05:32.198 HazelHelper[534] DEBUG: Thread 0x604000069000: Task removed: [3269]

___________________________________

and now i run it manually and it does update:

2018-09-05 20:10:06.668 hazelworker[3275] DEBUG: About to process directory /Users/jk/Desktop/syncA
2018-09-05 20:10:06.671 hazelworker[3275] DEBUG: .DS_Store: File is hidden/invisible. Skipping.
2018-09-05 20:10:06.671 hazelworker[3275] DEBUG: .com.greenworldsoft.syncfolderspro: File is hidden/invisible. Skipping.
2018-09-05 20:10:06.681 hazelworker[3275] z1.txt: Rule copy file if did change matched.
2018-09-05 20:10:06.681 hazelworker[3275] DEBUG: Manual run. Forcing actions to be executed.
2018-09-05 20:10:06.687 hazelworker[3275] DEBUG: Could not create trash directory at /.Trashes/502: Error Domain=NSCocoaErrorDomain Code=513 "You don’t have permission to save the file “502” in the folder “.Trashes”." UserInfo={NSFilePath=/.Trashes/502, NSUnderlyingError=0x7fe2e0c61940 {Error Domain=NSPOSIXErrorDomain Code=13 "Permission denied"}}
2018-09-05 20:10:06.718 hazelworker[3275] [File Event] File copied: z1.txt copied from folder /Users/jk/Desktop/syncA to folder /Users/jk/Desktop/syncB.
2018-09-05 20:10:06.719 hazelworker[3275] DEBUG: Rule requires extra matching pass.
2018-09-05 20:10:06.722 hazelworker[3275] DEBUG: Writing out DB file: /Users/jk/Desktop/syncA
2018-09-05 20:10:06.739 hazelworker[3275] DEBUG: Directory /Users/jk/Desktop/syncA processed in 0.070580 seconds
2018-09-05 20:10:06.740 HazelHelper[534] DEBUG: Checking events for path /Users/jk/Desktop/syncA, folder syncA
2018-09-05 20:10:06.740 hazelworker[3275] DEBUG: Sending metrics to scheduler. Next scheduled run:
2018-09-05 20:10:06.741 HazelHelper[534] DEBUG: Received metrics for folder /Users/jk/Desktop/syncA: {
directoryDepth = 0;
requestedSchedulingTime = "";
triggerPaths = "<ComNoodlesoft_NoodlePathSet: 0x60000023a6c0> - (\n)";
unavailablePaths = "{(\n)}";

thanks for your help!
joh
 
Posts: 3
Joined: Wed Sep 05, 2018 1:53 am

Re: only one action runs Thu Sep 06, 2018 12:01 pm • by Mr_Noodle
Ah, the problem is that the file is always matching that rule because of the created date condition. When a file matches a particular rule, it executes the action the first time. If it continues to match the same rule, it won't execute the actions. Running rules manually forces rules to run regardless of this.

It might be better to split that up into two rules. If the condition is just "Date last modified is after date last matched", then it will alternate between matching and not matching so the rules should fire each time it's modified. The create rule will only ever match once.
Mr_Noodle
Site Admin
 
Posts: 11240
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: only one action runs Thu Sep 06, 2018 8:55 pm • by joh
my brain is too small to understand but i changed it into two rules as you suggested and it works so thank you mr.noodle!!! hopefully, given time, i will learn...
:)
joh
 
Posts: 3
Joined: Wed Sep 05, 2018 1:53 am

Re: only one action runs Tue Sep 18, 2018 6:59 am • by Trickyt57
In the answer, it was suggested that you should split your rule into 2 separate rules.


Just in case, if you have a series of rules such as
Rule 1: if file is new copy it to folder ABC
Rule 2: if a file date is later than 2018-09-15, copy it to folder DEF

Then don’t forget that if rule 1 is executed, rule 2 will never execute, unless you add the instrution: “Continue matching rules”

This action tells Hazel to continue matching against subsequent rules instead of stopping. Normally Hazel stops once it finds a match, but this action indicates that rule evaluation should continue. Note that you cannot continue evaluation if the file or folder is moved out of the monitored folder. Therefore, you can’t use this action in conjunction with the “Move” or “Sort into subfolder” actions.
Trickyt57
 
Posts: 55
Joined: Tue Sep 18, 2018 12:17 am


Return to Support