mailing output of launchd jobs

Christopher Bort topher at thehundredacre.net
Wed Feb 28 14:11:25 PST 2007


I'm finally getting around to looking into converting some existing cron
jobs to launchd jobs. Everything seems pretty straightforward except for
one thing. I have a number of cron jobs that are set up to e-mail their
output to an admin address by simply setting a MAILTO in the appropriate
crontab. I've spent a bit of time Googling this and I can't find whether or
not there is a directly equivalent functionality with launchd.

I've tried adding 

<key>EnvironmentVariables</key>
<dict>
    <key>MAILTO</key>
    <string>address at domain.tld</string>
</dict>

to a launchd job's plist, where address at domain.tld is replaced with a valid
address, but that doesn't seem to work. Is there a simple way to do this? I
know that I can put each job in a wrapper script that would mail the
output, or some similar strategy, but that seems like a step backward when
launchd is supposed to be a step forward.

-- 
Christopher Bort
<topher at thehundredacre.net>
<http://www.thehundredacre.net/>


More information about the MacOSX-admin mailing list