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

bladepit

macrumors newbie
Original poster
Nov 30, 2014
2
0
Trying to create a task that starts on every day at 4AM to restart my mac and execute some maintenance scripts. This is my script:

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>local.job</string>
    <key>ProgramArguments</key>
    <array>
            <string>/usr/bin/osascript</string>
            <string>/Users/Media/Scripts/RestartMac.scpt</string>
    </array>
    <key>RunAtLoad</key>
    <false/>
    <key>StandardErrorPath</key>
    <string>/Users/Media/Scripts/Output/RestartMac.txt</string>
    <key>StandardOutPath</key>
    <string>/Users/Media/Scripts/Output/RestartMac.txt</string>
    <key>StartCalendarInterval</key>
    <array>
            <dict>
                    <key>Hour</key>
                    <integer>04</integer>
                    <key>Minute</key>
                    <integer>00</integer>
            </dict>
    </array>
</dict>
</plist>

If i run launchctl unload / load to reload my plist file it will execute the script. I am a bit confused cause i have set the RunAtLoad parameter to false. Tried a lot of things but i am unable to get it running. Has anyone an idea what is my fault here?

Operation system: OS X 10.9
 
The default of the RunAtLoad key is false. Things you can try :
  • remove the RunAtLoad key
  • try another label string
  • new plist with only label and programarguments
  • <array> not necessary when using only one calendarinterval
  • <integer>4</integer>
  • <integer>0</integer>
 
Last edited:
Don't know why but this worked. Copied the plist file and just renamed it and changed the label.

Thanks!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.