[SunHELP] syslog send a mail

Cloud L. Lee siyeclover at online.ie
Wed Jan 26 07:18:58 CST 2005

Thanks ,Matthew and James.

I want it's real time.
It send a mail immediately after syslog make a message.
cron isn't real time.
Is logwatch real time?

Matthew Hattersley wrote:

>Your best bet is to create a log rotation script.... IE: pipe all the
>authpriv messages to a given file. Once a day via a cron run a script
>like this:
>cp /var/log/auth.log /tmp/auth
>echo "" > /var/log/auth.log		
># Echoing to the file as opposed to removing it and touching it ensures
># that the inode wil not be changed and logging will be consistant
>subject="Auth Logs from: `date`"
>from="test at test.com"
>(echo $body; unix2dos /tmp/auth|uuencode /tmp/auth.txt) | mailx -s \
>"$subject" -r "$from"
>This script should send the log as an attachment, which keeps things
>Hope this helps
>On Wed, 2005-01-26 at 15:29 +0800, Cloud L. Lee wrote:
>>Can syslogd send a mail to a user?
>>For example, all authpriv.* messages will be send to someuser at somehost.com.
>>How to do it?
>>Thanks for help

Cloud L. Lee

More information about the SunHELP mailing list