Copyright 2011 Technoids.com
PLIST or Preference File, also known as a "properties file," is used by Mac OS X applications; formatted in XML and based on Apple's Core Foundation DTD; contains properties and configuration settings for various programs. Plist files for idevices are very similar to the Mac OS X structure.
A good free Windows Plist editor is
here
launchctl list Lists running and available plists - Status 1 means its not working probably due to a permissions issue
launchctl unload -w /System/Library/LaunchDaemons/com.apple.name.plist Unloads plist and makes it unavailable
launchctl load -w /System/Library/LaunchDaemons/com.apple.name.plist Loads the plist and makes it available
launchctl start what.ever.name.plist Starts the plist now ( HINT: Use the name from launchctl list not the full plist name )
Your Custom Plist(s) should always be in /Library/LaunchDaemons/
When running a shell script from the Plist make sure the whatevername.sh file permissions are set to 755
Run On Demand Sample Plist
com.http.lighttpd.plist
<?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.http.lighttpd</string>
<key>OnDemand</key>
<false/>
<key>Program</key>
<string>/usr/sbin/lighttpd</string>
<key>ProgramArguments</key>
<array>
<string>/usr/sbin/lighttpd-angel</string>
<string>-f/etc/lighttpd.conf</string>
<string>-D</string>
</array>
</dict>
</plist>
Run At Startup Sample Plist
com.http.lighttpd.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.http.lighttpd</string>
<key>ProgramArguments</key>
<array>
<string>/usr/sbin/lighttpd</string>
<string>-f</string>
<string>/etc/lighttpd.conf</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
Run Daily at 3:15 AM Sample Plist
com.awstats.logs.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.awstats.logs</string>
<key>ProgramArguments</key>
<array>
<string>/Library/Scripts/logs.sh</string>
</array>
<key>LowPriorityIO</key>
<true/>
<key>Nice</key>
<integer>1</integer>
<key>StartCalendarInterval</key>
<dict>
<key>Hour</key>
<integer>3</integer>
<key>Minute</key>
<integer>15</integer>
</dict>
</dict>
</plist>
Run Every 5 Miuntes Sample Plist
com.ping.check.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.ping.check</string>
<key>ProgramArguments</key>
<array>
<string>/Library/Scripts/ping.sh</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>OnDemand</key>
<true/>
<key>StartInterval</key>
<integer>300</integer>
</dict>
</plist>
HINT:
SSH
mdir /Library/Scripts
chmod 755 /Library/Scripts/ping.sh