Software to SEND log files only?

Bas Smeelen b.smeelen at
Wed Sep 22 07:02:39 UTC 2010

On 09/21/2010 10:17 PM, Len Conrad wrote:
> ---------- Original Message ----------------------------------
> From: Ed Flecko <edflecko at>
> Date:  Tue, 21 Sep 2010 12:56:13 -0700
>> According to the FreeBSD website
>> (, 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

cd /home/www

LOGFILES=`ls */logfiles/errorlog.txt`

for i in $LOGFILES
    if [ -s $i ]
        tail -r -n 100 $i |mail -s $i <email_address>

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.

More information about the freebsd-questions mailing list