Mac OSX:Plist运行程序样本

下面是两个可运行的 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>org.sohu.MyScript</string>
    <key>ProgramArguments</key>
    <array>
        <string>/sbin/MyScripts/MyScript</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
    <key>StartInterval</key>
    <integer>900</integer>
</dict>
</plist>


*****************************************
This plist file could be saved in /Library/LaunchDaemons/com.acme.disablespotlightonbackup.plist
and do: chmod 644; chown root:admin
and sudo launchctl load /Library....backup.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.acme.disablespotlightonbackup</string>
        <key>OnDemand</key>
        <true/>
        <key>ProgramArguments</key>
        <array>
                <string>/full/path/to/shell/script/created/above</string>
        </array>
        <key>StartCalendarInterval</key>
        <dict>
                <key>Munute</key>
                <integer>1</integer>
        </dict>
</dict>
</plist>
原文链接: http://blog.csdn.net/afatgoat/article/details/3192213

你可能感兴趣的:(Mac OSX:Plist运行程序样本)