I have the following plist file at ~/Library/LaunchAgents:
<?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.yogapo.test_launchd</string>
<key>Program</key>
<string>. /Users/luke/dev/data_yogapo/script/test_launchd.sh</string>
<key>StartInterval</key>
<integer>10</integer>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
And the test_launchd.sh file is contains the following:
#! /bin/bash
echo "hello world from test_launchd.sh" >> /Users/luke/dev/data_yogapo/log/development.log
When I run test_launchd.sh manually with
. /Users/luke/dev/data_yogapo/script/test_launchd.sh
the results are as expected: the line appears at the end of development.log
But when I load up this plist file, nothing happens:
$ cd ~/Library/LaunchAgents
$ launchctl load com.yogapo.test_launchd.plist
$ launchctl list | grep yogapo
- 1 com.yogapo.test_launchd
I've tried this with and without the RunAtLoad key. I've looked at other answers here on SO as well as elsewhere on the internet. I've followed tutorials, and there's simply nothing happening. Any help much appreciated - thanks!