`
xitong
  • 浏览: 6224676 次
文章分类
社区版块
存档分类
最新评论

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>
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics