Linux mail to Windows NT
In Linux (RedH V6.2) is there a way I can send the message log that sits in /var/spool/mail "root" file to a Windows machine as an email? Any suggestions.....
|
/var/spool/mail/root is kinda like root's "unopened mail"box, so this can contain a lot of stuff, but basically it's text.
just execute "cat /var/spool/mail/root | mail -s "(subject)" address1@host2 address2@host3". If you rather would daily send the /var/log/messages or any other logfile before it gets logrotated, you can set up a cronjob (maybe as a pre-logrotate script) to mail it. Find the name of the logfile in /etc/logrotate.d, open up the script, itll show /var/log/<filename>{ lotsa options lotsa options lotsa options } just make it look like /var/log/<filename>{ prerotate cat /var/log/<filename> | mail -s "" address@host endscript lotsa options lotsa options lotsa options } ofcourse you can also do daily mailing without relying on logrotated, then just dump the mailscript in /etc/cron.daily... HTH somehow |
The "cat" command works fine but I can't get it to log it daily.
The config file is /etc/logrotate.d/syslog The first couple of lines read : /var/log/messages { postrotate /usr/bin/killall -HUP syslogd endscript } I have changed it to : /var/log/messages { prerotate cat var/log/messages | mail -s "" jadmin@myhost.com endscript } Is the above correct? Should I keep the original postrotate line and add the prerotate? As the way I have it does not do the email Any suggestions..... I tried adding the following (as an example): |
All times are GMT -5. The time now is 10:39 AM. |