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

SecurityTinker

macrumors newbie
Original poster
May 11, 2008
28
0
Hello there.

I am testing out launchd through the use of Lingon because I have heard that it is the best way to schedule things on OS X. Right now I am testing it with a one line command "say". It executes at 12 midnight, daily.

My dilema is, sometimes, when my computer is sleeping at midnight and I wake it, say at 7 AM, my "say" command will activate. Worse yet, if I have multiple commands running daily and the computer is sleeping, they will all execute at once when the computer is woken. How do I prevent the commands from running if their time has past?
 

andyboutte

macrumors member
Sep 23, 2009
37
0
I can't say I have ever seen an option for that. The Apple doc says the following:

StartCalendarInterval <dictionary of integers or array of dictionary of integers>
This optional key causes the job to be started every calendar interval as specified. Missing arguments
are considered to be wildcard. The semantics are much like crontab(5). Unlike cron which skips job
invocations when the computer is asleep, launchd will start the job the next time the computer wakes
up. If multiple intervals transpire before the computer is woken, those events will be coalesced into
one event upon wake from sleep.


http://developer.apple.com/library/.../Reference/ManPages/man5/launchd.plist.5.html
 

SecurityTinker

macrumors newbie
Original poster
May 11, 2008
28
0
Ah, thank you for that. I guess it was not programmed in. I guess I could hack away at using if statements in my script but then it will not be one line anymore. Ah well.
 

Mattie Num Nums

macrumors 68030
Mar 5, 2009
2,834
0
USA
Hello there.

I am testing out launchd through the use of Lingon because I have heard that it is the best way to schedule things on OS X. Right now I am testing it with a one line command "say". It executes at 12 midnight, daily.

My dilema is, sometimes, when my computer is sleeping at midnight and I wake it, say at 7 AM, my "say" command will activate. Worse yet, if I have multiple commands running daily and the computer is sleeping, they will all execute at once when the computer is woken. How do I prevent the commands from running if their time has past?

What are you trying to schedule? It could be possible that it can be done a different way.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.