27 Aug
2008
27 Aug
'08
6:28 p.m.
Hello, I often need to schedule scripts to run at an interval, but I don't know how long that script will take to complete and I don't want the script to run again at its normal interval unless the script isn't running. I've done this with pid files and grepping through ps lists to exit the script if another instance is running, but I was wondering if there is something built into launchd to handle this. I tried combining LaunchOnlyOnce with StartInterval, but with LaunchOnlyOnce, it seems that the job gets unloaded as soon as it runs, so the interval becomes pretty meaningless. Is there a way to do this with launchd? Should there be a way to do this with launchd? Thanks, Kyle