how to send "mailto" from cron job (/var/cron/tabs/*) that details outcome?

Back on Nov 27, Charles Minow told me how to generate an email summarizing the results of the periodic daily/weekly/monthly jobs (by the way, Charles, thanx! Works great!).

So, now I'm wondering, for cron jobs located in /var/cron/tabs/, how would one similarly generate an email to be sent to an email address of one's choice, that detailed the outcome of each such cron job?

Thanx in advance!

2001 Quicksilver G4, Mac OS X (10.4.4)

Posted on Jan 29, 2006 12:55 PM

Reply
2 replies

Jan 29, 2006 1:32 PM in response to j.v.

There are several ways of doing this.

By default the output of any cron job would be mailed to the user's local mail account, so one option would be to setup mail forwarding from the system to the user's regular mail account.

The other option is to simply pipe the output of the cron task to mail, like:

1 2 * * * /path/to/your/task | mail you@yourdomain.com

Now when the specified task runs, its output will be passed to mail and sent to the specified address.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

how to send "mailto" from cron job (/var/cron/tabs/*) that details outcome?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.