5 Replies Latest reply: Sep 4, 2010 3:47 PM by GreybeardCT
Todd Heberlein1 Level 1 Level 1 (30 points)
Continuing testing with launchd. It's driving me crazy. I feel like it is broken. I am trying to run a program every 5 minutes using StartCalendarInterval.

(0) I have a Mac Mini with very few process running (I have Terminal app up with two windows and the web server running).

(1) I created a very simple UNIX program to create a file (with the file name derived in part from the system time).

(2) After, say 3:05 pm I do an "ls" in the directory where the UNIX program should write the file, but it isn't there. However, if I immediately do another "ls", the file is there with the current time.

I've even waited over 2 minutes after the scheduled run of the program -- do an "ls" (new file is not there) followed immediately by another "ls" and there is the file.

It almost seems that if I don't initiate some action (e.g., running the "ls" command), launchd will not run my program. It is as if launchd is asleep at the switch until something happens (a new process is created?).

Should I give up on launchd for scheduling operations on an otherwise quiet machine?

Mac Mini 2.4 GHz Intel Core 2 Duo, Mac OS X (10.6.4)