Re: How to control a Launchdaemon
Re: How to control a Launchdaemon
- Subject: Re: How to control a Launchdaemon
- From: Tom Robinson <email@hidden>
- Date: Wed, 18 Jan 2017 09:34:40 +1300
Have the script write a file (or use a persistent variable) to keep track of when it last sent an e-mail for a device, and only send another e-mail if x amount of time has passed? That way the daemon’s always loaded, and the script looks after itself.
> On 2017-01-18, at 05:51, Jim Weisbin <email@hidden> wrote:
>
> I maintain a lot of servers, each of which have numerous external drives/arrays attached. Occasionally one of these arrays will go off line (I’ve been having a lot of problems with aging OWC “Qx2” units which simply go off line instead of going into alarm). So I wrote a script (actually an app) that I run every hour using Launchctl, which checks a list of drives that should be mounted, and emails me if any are not mounted. Works fine, but here’s my question: if a drive is off line, I will continue to get an email every hour until I unload the daemon. Or, I could create a file and write to it, then check it as a flag so that it won’t email me if the flag is set. But then I have to manually clear the flag, which seems like just as much trouble as unloading the daemon. I could also possibly unload the daemon from the script itself, not sure if that’s possible. Can anyone think of a better way to handle this?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden