I'm using logrotate to rotate my log files.
I've set it up to create new logfiles every week.
However I would like it to first mail me the logfiles as attachments.
The /var/log/httpd file currently contains:
/var/log/httpd/*log {
missingok
notifempty
sharedscripts
firstaction
{I think I need to mail the logfiles here???}
postrotate
/sbin/service httpd reload > /dev/null 2>/dev/null || true
endscript
}
Is it possible to do what I want?
If so: what do I need to add to firstaction for it to:
- mail me the logfiles (
/var/log/httpd/*log) as attachment using sendmail - add some subject to the mail, e.g.:
HTTPD logfiles {week #}