-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using iCalBuddy in a cron process #5
Comments
The I suggest you try using launchd (see |
Why would it work when launch interactively though? |
I got the same error when trying to set up a cron job for this. I can confirm that launchd works. |
Is this the same as the issue I am facing where icalBuddy will not work headless? If I ssh into my machine, invoking icalBuddy results in "error: No calendars". It works fine from a shell opened directly on the machine. |
Same for me. Invoking icalBuddy via launchd didn't work either, but I found an easy way out.
|
@knu Holy crap, that's the trick to make the damn thing work on a cron process. Legend! |
Commenting here to let you know this workaround works for Ventura 13.2.1! @knu you're a monster thank you so much. Also, it turns out I didn't even need to call the app I created from within the crontab—just allowing the permissions once (which in my case, Automator only asked for Documents access) made calling my original script from the crontab work. Afterwards, I could even remove those permissions within Settings > Privacy & Security and it still worked. |
Hey @bburgess19. I assumed above two points, and tried something similar but did not work for me. My end goal is to periodically save the output of |
@HarshalRohit I basically only followed the instructions until manually opening the .app, at which point it asked for permissions to my Documents folder. Once I granted them, my script ran as expected through cron. Hope this helps, and sorry for the tricky troubleshooting! |
I have a quick question about iCalBuddy I couldn’t find a response for in the docs
I have icalbuddy installed in /usr/local/bin and it works flawlessly from command line:
/usr/local/bin/icalBuddy -ea -tf "%H:%M" -b "" -li 4 -n -eed -npn -nc -ps "/ | /" -eep "location,notes,attendees” eventsToday
When I first ran it, if I recall, it asked me to give it access to my calendars which I did. No problem here. This is on Mavericks by the way.
However when I run it from the cron, I see this error in the system.log:
Jul 18 09:37:34 EDASQUEMAC1 icalBuddy[47140]: SecOSStatusWith error:[-34018] The operation couldn’t be completed. (OSStatus error -34018 - Remote error : The operation couldn‚Äôt be completed. (OSStatus error -34018 - client has neither application-identifier nor keychain-access-groups entitlements))
In the error stream for iCalBuddy I see:
2014-07-18 09:14:01.632 icalBuddy[38807:d07] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* +[CalCalendarStore eventPredicateWithStartDate:endDate:calendars:]: calendars is nil'
*** Call stack at first throw:
(
0 CoreFoundation 0x96274471 __raiseError + 193
1 libobjc.A.dylib 0x909b8091 objc_exception_throw + 162
2 CoreFoundation 0x9627438b +[NSException raise:format:] + 139
3 CalendarStore 0x0002b5e6 +[CalCalendarStore eventPredicateWithStartDate:endDate:calendars:] + 260
4 icalBuddy 0x00005f93 getEvents + 611
5 icalBuddy 0x0000624c getCalItems + 172
6 icalBuddy 0x00002609 main + 1257
7 icalBuddy 0x00002075 start + 53
)
It seems that iCalBuddy when ran from cron from the same user requires some permission that it doesn’t have. Any idea on how to fix this?
The text was updated successfully, but these errors were encountered: