launchd to launch shell scripts
I've written a shell script that I'd like launchd to periodically run. I've created the plist file for /Library/LaunchDaemons/ and loaded it with launchctl, and everything works just like it should except for one part.
Basically, the script does a du on user homes and then is supposed to send me an email that contains a list of offending user homes and their disk usage.
The bash script I've written works perfectly when run from terminal as my admin user, however when it's launched via launchd, the body of the message is never attached and I simply get a blank message.
/usr/bin/mail -s "Disk Usage $userType $serverHost" $fromAddress