Forum Discussion
Spot the rookie error
Interesting. Is it kicking off and giving an error, or just not kicking off?
If it's kicking off, it might need to be sudo'd.
Also, not sure what the '--schedule' switch really does, but it might have something to do with it.
Looking at Creating Launch Daemons and Agents:
I'm guessing you've seen the example for StartCalendarInterval. I'm also assuming the file is in the right folder (one of ~/Library/, /Library/, or /System/Library/; in either the LaunchDaemons or LaunchAgents folders) with the right permissions.
It's not kicking off, it reports "Invalid property list".
it's in /Library/LaunchDaemons and should start with sudo launchctl load /Library/LaunchDaemons/YourMac.name.here.SftwrUpdt.plist
I finally got tired and set it aside for now.
I've scrutinized it for syntax errors and searched for the reason that it's invalid.
Different versions of OS X use different file locations and the finished (working) plist might be version dependant, idk.
the "softwareupdate" command works from terminal so thus far I just haven't figured it out.
I'll have to go back and study Creating Launch Daemons and Agents to see what I might be missing.
I was going to use cron but since it's depreciated and I wanted to help as many ppl as possible I went with Launchd.
Just a work in progress - I thought I would share with you.
Don :)
- MarkJFine8 years agoProfessor
Hmm... I copied/pasted into a text file, then opened it in Xcode and it seemed to read like a proper plist, so the 'invalid' thing is very strange.
Sounds like my kind of challenge. I'll kick it around as well to see what I can get working. Maybe together we can solve this.
I agree that this can ultimately be very helpful to other Mac users that want to automate updates in the Bonus period - or for anyone that just wants to do things overnight for that matter.
I can even create a frontend in Xcode that creates/positions the file with the desired softwareupdate options once we figure out the what and where.
- donsjgm8 years agoJunior
FWIW I just opened a terminal and pounded out the code following sample structures of course.
I've done some more searching (do my best thinking in the middle of the night... uninterrupted LOL) and I don't think it has to have a listener. (but maybe)
It might need a keep alive but that can be added (if necessary) after It will load.
I've played around with the StandardErrorPath and the StandardOutputPath thinking (at first) the problem might be there.
Apparently it's not that easy a task or someone somewhere would have written it.
It's clearly something that satellite users could benefit from.........
Hopefully together we can do this for the community.
I'll keep you posted with any progress here.
Good Luck
Don :)
- MarkJFine8 years agoProfessor
Try this, just for grins:
1. Create a UTF-8 text file called com.example.softwareupdate.plist and put this in it:
-----8<----<?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.example.softwareupdate</string>
<key>ProgramArguments</key>
<array>
<string>softwareupdate</string>
<string>--download</string>
<string>--all</string>
</array>
<key>StartCalendarInterval</key>
<dict>
<key>Hour</key>
<integer>2</integer>
<key>Minute</key>
<integer>10</integer>
</dict>
</dict>
</plist>-----8<----
2. Move the file to ~/Library/LaunchAgents/
3. Change the privileges to owner, rw only:
chmod 600 com.example.softwareupdate.plist
4. See if that works
Related Content
- 2 years ago
- 4 years ago
- 8 years ago