Re: [launchd-dev] Questions on mixed triggers and calendar triggers
On Jul 23, 2010, at 9:21 AM, Michael_google gmail_Gersten wrote:
For instance, is it possible to launch a daemon both on schedule with StartCalendarInterval and a mach message? The idea being the process would be run at a specific time of the day but could also be launched "manually".
Yes. Though why would you want your daemon to run on a timer interval if you can just launch it on-demand whenever you need to?
Maybe you want it to run once an hour anyways.
Why? I'm of the opinion that in most cases, when people use a timer, they're using it as a substitute for tracking some state which they cannot track.
Maybe you also want it to run when a disk is attached.
Maybe you even want it to run when you wake from sleep.
Neither of those is possible currently. So yeah, I guess you could run it every hour to make up for it... but why every hour?
** Is there any way for a user program to run on disk attach and/or wake from sleep, or is that feature for Time Machine hardcoded? The only way I can get my scripts to run at wakeup or attach is by hijacking Time Machine's. (run my script instead of backup-helper; my script calls backup-helper)
TimeMachine uses SPI. -- Damien Sorresso BSD Engineering Apple Inc.
Yes. Though why would you want your daemon to run on a timer interval if you can just launch it on-demand whenever you need to?
...
Why? I'm of the opinion that in most cases, when people use a timer, they're using it as a substitute for tracking some state which they cannot track.
It strikes me as a legitimate choice of presenting the user with the option to have a scheduled task coupled with the ability to trigger on-demand execution whenever desired. And, yes, it is entirely possible for there to be some external state or processes which could make that the best choice for what is within your scope of control.
participants (2)
-
Damien Sorresso
-
Joseph Jacobs