Skip to content

Instantly share code, notes, and snippets.

@CLCL
Last active August 29, 2015 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CLCL/4d611211728e2bf8ba06 to your computer and use it in GitHub Desktop.
Save CLCL/4d611211728e2bf8ba06 to your computer and use it in GitHub Desktop.
Mac OS Xにはもはやcronがないのでlaunchdに定時実行を登録する
<?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>mikudayo</string>
<key>ProgramArguments</key>
<array>
<string>say</string>
<string>-v</string>
<string>Kyoko</string>
<string>初音ミクだよー</string>
</array>
<key>StartInterval</key>
<integer>15</integer>
<key>StandardErrorPath</key>
<string>/dev/null</string>
<key>StandardOutPath</key>
<string>/dev/null</string>
</dict>
</plist>
<!--
例として、15秒ごとに「初音ミクだよー」としゃべります(Kyokoが)。
設定
$ vi ~/Library/LaunchAgents/mikudayo.plist
設定を登録
$ launchctl load ~/Library/LaunchAgents/mikudayo.plist
設定を解除
$ launchctl unload ~/Library/LaunchAgents/mikudayo.plist
-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment