Operating System - HP-UX
1752536 Members
5094 Online
108788 Solutions
New Discussion юеВ

log report updates required daily via email

 
bob the spod
Occasional Advisor

log report updates required daily via email

Currently everyday I have to go onto 10 different servers and access a directory to check a backup log and cut and paste the current days info into a text document (saved weekly)
I guess theres got to be a way I can set up a way of getting that new info (for the current day)sent to me by e-mail
I only want the new info not the whole log.

How would you or do you do this?

cheers peeps
BOB ;^)
you make me feel like dancing (gonna dance the night away!)
5 REPLIES 5
Jean-Luc Oudart
Honored Contributor

Re: log report updates required daily via email

For syslog you could run somthing like
d1=$(date "+%b %d")
grep ^"$d1" /var/adm/syslog/syslog.log | mailx -s "syslog " user@mycompany.com

Rgds,
Jean-Luc
fiat lux
bob the spod
Occasional Advisor

Re: log report updates required daily via email

its not syslog
its just a file which has extracted data regarding whether a back up was succesful or if errors were detected etc..

you make me feel like dancing (gonna dance the night away!)
aparna challagulla
Valued Contributor

Re: log report updates required daily via email

hi bob,

u just need to substitute ur path/filename inthe place of syslog in the solution given by Jean-Luc to get ur log/file in your mail.

HTH
aparna
If you don't have time to do it right you must have time to do it over
Graham Cameron_1
Honored Contributor

Re: log report updates required daily via email

Well you could script all this.
From a central server you could go and get all the backup logs.
You could keep yesterdays logs, get the new ones, and for each server, run something like
--
diff today.log yesterday.log | mailx -s "Backup logs for $(date)" you@youraddress

Then copy todays over yesterdays.
etc, etc...
--
But it would be much better to use one of the freeware tools that do all this and much more.
My favourite is big brother http://www.bb4.com/

-- Graham
Computers make it easier to do a lot of things, but most of the things they make it easier to do don't need to be done.
Steven E. Protter
Exalted Contributor

Re: log report updates required daily via email

Have cron on the various boxes run the whole report via email

example

* * * * * /usr/contrib/bin/logrep 2>&1 | mailx "log report" someone@yourcompany.net

Have the script itself use the tail command or otherwise process the log so you only get what you need.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com