xxx.plist
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
<?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>myjob</string> <key>ProgramArguments</key> <array> <string>/Users/Alice/scripts/myscript.sh</string> </array> <key>LowPriorityIO</key> <true/> <key>Nice</key> <integer>1</integer> <key>StartCalendarInterval</key> <dict> <key>Hour</key> <integer>18</integer> <key>Minute</key> <integer>01</integer> </dict> <key>StandardOutPath</key> <string>/usr/local/var/log/myscript.log</string> <key>StandardErrorPath</key> <string>/usr/local/var/log/myscript.log</string> </dict> </plist> |
起動コマンド
1 |
$ sudo launchctl load xxx.plist |
停止コマンド
1 |
$ sudo launchctl unload xxx.plist |