Scheduled run of shell script never runs?

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

Moderator: Mr_Noodle

Scheduled run of shell script never runs? Wed Sep 28, 2016 10:20 pm • by HackerJL
I use hazel since its reliable as hell. So when crontab in OSX wasn't working a long time ago, I wrote a rule in hazel.

If the current time is X - any day,
run shell script, and then plopped an rsync command.

Since the upgrade to Sierra, it ...doesnt seem to ever run.

I can copy/paste the command out of Hazel into terminal, works great.

Anything change in the process that I should alter?
HackerJL
 
Posts: 31
Joined: Thu Sep 22, 2011 6:28 pm

Re: Scheduled run of shell script never runs? Thu Sep 29, 2016 10:06 am • by Mr_Noodle
Try going through the troubleshooting guide here: https://www.noodlesoft.com/kb/hazel-tro ... ing-guide/

That should isolate where the problem is. Post the results here if you still have problems with it.
Mr_Noodle
Site Admin
 
Posts: 11872
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Scheduled run of shell script never runs? Sat Nov 12, 2016 1:50 pm • by DaveB
After upgrading to Sierra, my Hazel rules began throwing an error and files weren't getting imported into EagleFiler.

I checked the log and searched the internet and found a solution to fix it.
I just needed to use Terminal and reinstall xcode.

xcode-select --install

It seems Hazel could no longer execute shell scripts after I installed Sierra because Xcode needs to be re-authenticated after upgrading to Sierra.

This was the log entry after the error:

Code: Select all
})(shellscript:/bin/bash:38dd7e485b45b30e981d7e23c20449b9,{
})(rename:(
    "{dateCreated}",
    "--BankNameHere"
),{
})(move:/Users/bartholomewd/Documents/Paperless-Library_local/Files/Documents/Banking-Financial,{
    keepFolderStructure = 0;
    replaceExisting = 0;
    throwAwayDupes = 0;
})(applescript:,{
})}
2016-11-11 17:28:14.115 hazelworker[8796] DEBUG: == script output ==
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

== End script output ==


So as I said above, to fix the shell script issue after upgrading to Sierra, open Terminal and paste"

xcode-select --install
Then, hit Return.

MacOS will ask you to enter your password, re-authenticating the Xcode command line tools. And then re-run Hazel and things may work just fine again. They did for me.

-Dave
DaveB
 
Posts: 25
Joined: Sat Apr 02, 2016 7:56 pm

I'll try it!!

DaveB wrote:After upgrading to Sierra, my Hazel rules began throwing an error and files weren't getting imported into EagleFiler.

I checked the log and searched the internet and found a solution to fix it.
I just needed to use Terminal and reinstall xcode.

xcode-select --install

It seems Hazel could no longer execute shell scripts after I installed Sierra because Xcode needs to be re-authenticated after upgrading to Sierra.

This was the log entry after the error:

Code: Select all
})(shellscript:/bin/bash:38dd7e485b45b30e981d7e23c20449b9,{
})(rename:(
    "{dateCreated}",
    "--BankNameHere"
),{
})(move:/Users/bartholomewd/Documents/Paperless-Library_local/Files/Documents/Banking-Financial,{
    keepFolderStructure = 0;
    replaceExisting = 0;
    throwAwayDupes = 0;
})(applescript:,{
})}
2016-11-11 17:28:14.115 hazelworker[8796] DEBUG: == script output ==
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

== End script output ==


So as I said above, to fix the shell script issue after upgrading to Sierra, open Terminal and paste"

xcode-select --install
Then, hit Return.

MacOS will ask you to enter your password, re-authenticating the Xcode command line tools. And then re-run Hazel and things may work just fine again. They did for me.

-Dave
HackerJL
 
Posts: 31
Joined: Thu Sep 22, 2011 6:28 pm

Re: Scheduled run of shell script never runs? Thu Dec 01, 2016 10:17 am • by HackerJL
Mr_Noodle wrote:Try going through the troubleshooting guide here: https://www.noodlesoft.com/kb/hazel-tro ... ing-guide/

That should isolate where the problem is. Post the results here if you still have problems with it.


Hey Mr_Noodle, I hope im not wrecking havoc here, but something is still up, and I can't track it down.

Fresh install of MacOS Sierra machine, installed hazel, and wrote a rule for a folder. The rule is simple, at this time of day, run this shell script. The script runs perfectly fine in terminal, without sudo, but copy/paste it into hazel shell script window...never seems to run, ever. I can't find anything in the logs to help me either. I wiped the machine thinking it was some leftovers from the upgrade, but now we are talking a virgin system.

Thoughts?
HackerJL
 
Posts: 31
Joined: Thu Sep 22, 2011 6:28 pm

Re: Scheduled run of shell script never runs? Thu Dec 01, 2016 11:54 am • by Mr_Noodle
Did you go through the guide? What does the preview and rule status show? Also, turn on debug logging and add diagnostics to the script to print things out.
Mr_Noodle
Site Admin
 
Posts: 11872
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Scheduled run of shell script never runs? Thu Dec 01, 2016 11:58 am • by HackerJL
Mr_Noodle wrote:Did you go through the guide? What does the preview and rule status show? Also, turn on debug logging and add diagnostics to the script to print things out.


I shall do again tonight. The preview rule status doesnt show anything cause its not that minute that it runs, but ill muck with that and see if I can get it to show.

When I looked at debug logging, I could never see anything. Will try again and let you know.

Thanks
HackerJL
 
Posts: 31
Joined: Thu Sep 22, 2011 6:28 pm

Mr_Noodle wrote:Did you go through the guide? What does the preview and rule status show? Also, turn on debug logging and add diagnostics to the script to print things out.


Good day Mr_Noodle.

Alright, so I thought I had some great headway, but alas I do not.

Long story short, it all works. When I'm sitting in front of it.

Let me explain.

Rule is that if the current time is 1pm, run the shell script. Easy.

I change the time to 2 minutes from now, it works great.

I change it to 1am, never runs.

Any freaking idea? Im going crazy.
HackerJL
 
Posts: 31
Joined: Thu Sep 22, 2011 6:28 pm

Re: Scheduled run of shell script never runs? Thu Dec 08, 2016 12:23 pm • by Mr_Noodle
Check the logs and email/post an excerpt around 1am.
Mr_Noodle
Site Admin
 
Posts: 11872
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support