• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to control a Launchdaemon
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >How to control a Launchdaemon (From: Jim Weisbin <email@hidden>)

  • Prev by Date: How to control a Launchdaemon
  • Next by Date: Looking for advice on 'Mail.app'
  • Previous by thread: How to control a Launchdaemon
  • Next by thread: Looking for advice on 'Mail.app'
  • Index(es):
    • Date
    • Thread