vixie-cron
e-mails me the output of cron jobs, with one message per job.
I would rather receive messages in batches, with either a configurable number of messages per batch or (better) each batch covering a defined time period. I already use logwatch to get daily e-mails; a solution that could be integrated into this system would be ideal.
I can't find a way of configuring vixie-cron
(version 4.1-81
) to output to a directory or a log file instead of directly to the SMTP client. I am aware that I can manually redirect the output to a different location in crontab
itself, but it seems like there should be a way to change the default.
I also wonder what the best tool for sending the e-mails would be (if not logwatch).
You can tell Cron to send the output to syslog. I believe that cron output will be sent to /var/log/cron on most systems. From here, you can create a logwatch job to scan /var/log/cron and send you the output once per day.
From man 8 cron:
On some distros, logwatch comes with a logwatch script named 'cron' and a configuration file named 'cron.conf'. See http://www.archlinux.org/packages/community/any/logwatch/files/ for one example. I do not have these files on my RHEL6 system.
What about settine the email address for a specific cron (MAILTO=mailname, if I recall) where all the mail messages go and have an alias to simply put it into a file. Then process the file as you wish, .... logrotate, or whatever else you want.