Date: Wed, 22 Sep 2010 09:02:37 +0200 From: Bas Smeelen <b.smeelen@ose.nl> To: freebsd-questions@freebsd.org Subject: Re: Software to SEND log files only? Message-ID: <4C99AA0D.2010009@ose.nl> In-Reply-To: <201009212217.AA256967036@mail.Go2France.com> References: <201009212217.AA256967036@mail.Go2France.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 09/21/2010 10:17 PM, Len Conrad wrote: > ---------- Original Message ---------------------------------- > From: Ed Flecko <edflecko@gmail.com> > Date: Tue, 21 Sep 2010 12:56:13 -0700 > > >> According to the FreeBSD website >> (http://www.freebsd.org/doc/handbook/outgoing-only.html), the easiest >> way to send mail only is to install the mail/ssmtp port. >> >> Does anyone have an example of a script or other method (maybe a cron >> script?) that would e-mail my log files to me daily? >> > log files can be (too) huge as smtp DATA. > > I zip mine and use the mpack port to send the .zip file as MIME attachment. > > Len You could install the logrotate port /usr/ports/sysutils/logrotate and switch the logfiles you want to this instead of newsyslog For webserver error logs I use something like this scripts which runs from cron #!/bin/sh cd /home/www LOGFILES=`ls */logfiles/errorlog.txt` for i in $LOGFILES do if [ -s $i ] then tail -r -n 100 $i |mail -s $i <email_address> fi done DISCLAIMER: This e-mail is for the intended recipient(s) only. Access, disclosure, copying, distribution or reliance on any of it by anyone else is prohibited. If you have received it by mistake please let us know by reply and then delete it from your system.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4C99AA0D.2010009>
