Check if a process has crashed

Discussion in 'OS X Mountain Lion (10.8)' started by tofagerl, Feb 13, 2013.

  1. macrumors 6502a

    May 16, 2006
    I'm having problems with the Carbonite backup app on my mothers laptop. It will crash and use all available CPU untill I manually force close it. Obviously, this is not ideal, and several times I only find out that this has happened after receiving an email from carbonite saying that it hasn't backed up for X days.

    So I have to options. One is to have cron close and restart it every X hours, and the other is to check via cron if the process has crashed (it will still be running, so pidof isn't an option) and only then close/restart it.

    I'm pretty sure bash doesn't know how to check if an app has crashed, but does AppleScript? How about any other scripting languages? Python?
  2. Moderator emeritus


    Jul 24, 2002
    There is no general purpose way to confirm if an app has crashed. Anything that claims to essentially relies on the process responding to some sort of signal within a time period. Failure to do so does not guarantee the process is crashed.
  3. thread starter macrumors 6502a

    May 16, 2006
    Which is out, since I have no idea how the process would respond... Maybe I could measure CPU time over a period of ten seconds or something, but that seems like it would have tons of false positives when a backup is actually run.

Share This Page