Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

If a launchd job has a StartInterval of 600 and it's been "some time" since the plist was loaded.

How can one determine how much time remains until the next scheduled run?

share|improve this question
add comment

2 Answers 2

You can't. Indeed launchd doesn't even guarantee to an interval of exactly 600 seconds, just close.

The best way to do something similar is to get your launchd task to touch a file, preferably in /var/tmp

share|improve this answer
add comment

It really depends on why you care (inherently, you shouldn't, or more likely, there's some better way to do it). It all comes down to your script being smarter. Drop a turd file or use the script to either defer until next run, or go into a holding pattern.

share|improve this answer
    
Agreed, in the running of our script, we dont' care. –  Allen Hancock Jan 9 '12 at 23:43
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.