[Logwatch] Hello and first question

logwatch at mikecappella.com logwatch at mikecappella.com
Thu Aug 25 17:07:00 MST 2005


> 
> On Thu, 2005-08-25 at 12:19, Clayton Cottingham wrote:
> > I am wondering if it is possible to send an email to root 
> AND save the 
> > logwatch file to the harddrive?
> > 
> 
> 
> datestamp=$(date -d -1day +%Y%m%d)
> /etc/log.d/scripts/logwatch.pl --print > 
> /tmp/$datestamp.logwatch
> /bin/mail -s "Logwatch for 
> $datestamp" root < /tmp/$datestamp.logwatch
> 
> exit
> 

And another method is to use the "tee" command:

  logwatch --print | tee /tmp/logwatch-$datestamp.log | \
	mail -s "Logwatch for $datestamp" root 



More information about the Logwatch mailing list