1

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).

supervacuo
  • 1,433
  • 2
  • 11
  • 10

2 Answers2

1

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:

-s

This option will direct cron to send job output to the system log using syslog(3). This is useful if your system has no sendmail(8), or if mail is disabled using -m off.

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.

Stefan Lasiewski
  • 23,667
  • 41
  • 132
  • 186
0

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.

mdpc
  • 11,856
  • 28
  • 53
  • 67