Logrotate: sending rotated logs to multiple email addresses and how to change subject and from field ?
Hi, I'm using logrotate to rotate my logs. But would like to send rotated logs to multiple email addresses and also customize subject and from fields in email... I haven't found any info on that on Internet - has anyone working example of such customizations and sending to multiple email addresses ? Any advice or pointer to proper docs - man logrotate doesn't mention this ? Thanks in advance, regards, Rob.
The Saturday 2005-05-07 at 10:40 +0200, Robert Rozman wrote:
I haven't found any info on that on Internet - has anyone working example of such customizations and sending to multiple email addresses ? Any advice or pointer to proper docs - man logrotate doesn't mention this ?
Logrotate can send at least to one email - if that one is local, you can set procmail there to forward to as many addresses as you want. Should work :-) -- Cheers, Carlos Robinson
On Sat, 2005-05-07 at 13:27 +0200, Carlos E. R. wrote:
The Saturday 2005-05-07 at 10:40 +0200, Robert Rozman wrote:
I haven't found any info on that on Internet - has anyone working example of such customizations and sending to multiple email addresses ? Any advice or pointer to proper docs - man logrotate doesn't mention this ?
Logrotate can send at least to one email - if that one is local, you can set procmail there to forward to as many addresses as you want. Should work :-)
Set up a group list in the aliases file, GrpEmail: address1,address2,address3 Call it whatever you want and add/remove addresses without having to change anything else. Just make sure you issue newaliases after making changes. -- Ken Schneider UNIX since 1989, linux since 1994, SuSE since 1998 "The day Microsoft makes something that doesn't suck is probably the day they start making vacuum cleaners." -Ernst Jan Plugge
On Saturday 07 May 2005 10:40, Robert Rozman wrote:
Hi,
I'm using logrotate to rotate my logs. But would like to send rotated logs to multiple email addresses and also customize subject and from fields in email...
I haven't found any info on that on Internet - has anyone working example of such customizations and sending to multiple email addresses ? Any advice or pointer to proper docs - man logrotate doesn't mention this ?
Thanks in advance,
You could just create an alias in /etc/aliases pointing to the addresses you want to send to, and then set that alias as the mail address in logrotate. The subject is hard coded though. But it's fairly simple to change the source to allow a subject to be set.
The Saturday 2005-05-07 at 14:24 +0200, Anders Johansson wrote:
You could just create an alias in /etc/aliases pointing to the addresses you want to send to, and then set that alias as the mail address in logrotate.
Cute, I forgot that :-)
The subject is hard coded though. But it's fairly simple to change the source to allow a subject to be set.
Or adjust to use formail in the middle, it can modify headers (I'd have to read the manual to see how, exactly). The procmail way I mentioned before ;-) -- Cheers, Carlos Robinson
participants (4)
-
Anders Johansson
-
Carlos E. R.
-
Ken Schneider
-
Robert Rozman