Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

tofagerl

macrumors 6502a
Original poster
May 16, 2006
983
428
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?
 

robbieduncan

Moderator emeritus
Jul 24, 2002
25,611
893
Harrogate
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.
 

tofagerl

macrumors 6502a
Original poster
May 16, 2006
983
428
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.