I have my backup shell script and it works as expected when run from the cli. It also runs ok from its LaunchAgent entry (in ~/Library/LaunchAgents/)
The problem is that the script uses /usr/bin/mail at the end of a run to send the content of the summary log to myself. When running from the prompt this is successful; however when running from launchd it simply does not send the email. the mail logs show no attempt at all from the script.
Any ideas?
The problem is that the script uses /usr/bin/mail at the end of a run to send the content of the summary log to myself. When running from the prompt this is successful; however when running from launchd it simply does not send the email. the mail logs show no attempt at all from the script.
Any ideas?
Code:
~/Library/LaunchAgents/com.local.lokibackup.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.local.lokibackup</string>
<key>ProgramArguments</key>
<array>
<string>/Users/MYUSER/Scripts/backup.sh</string>
</array>
<key>StartCalendarInterval</key>
<dict>
<key>Weekday</key>
<integer>1</integer>
<key>Hour</key>
<integer>16</integer>
<key>Minute</key>
<integer>10</integer>
</dict>
<key>UserName</key>
<string>MYUSER</string>
</dict>
</plist>
Last edited: