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

carterx

macrumors member
Original poster
Dec 4, 2006
58
13
I have a script that I wan to set for 3:30am daily and it does run at the set time but it also runs on every restart of the computer which I do not want.

How do I make this work with just the schedule in place and not run on every startup of the computer?

Here's my plist:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>com.xxxxx.xxxx</string>
    <key>ProgramArguments</key>
    <array>
        <string>/Library/Scripts/script.sh</string>
    </array>
    <key>StartCalendarInterval</key>
    <dict>
        <key>Minute</key>
        <integer>30</integer>
        <key>Hour</key>
        <integer>3</integer>
    </dict>
</dict>
</plist>
 
Does this occur every time or only when you have your computer tuned off at 3:30? If so that's an intended feature of StartCalendarInterval to not miss a scheduled job if the computer has been turned off. From the man page:

man launchd.plist said:
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.

There may be a key you can add to prevent this, I'm not aware of it though.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.