cron to attach a gz file

perryh at pluto.rain.com perryh at pluto.rain.com
Thu Jan 31 23:13:53 PST 2008


> > I know I can use
> > 
> > mail -s "logfile " < /var/log/httpd_access.log
> > 
> > in cron to email the content of a log file to a particular email
> > address but how do I make that log file a binary attachment (*.gz)?
>
> gzip -c /var/log/httpd_access.log | uuencode httpd_access.log.gz | mail 
> -s "logfile" someone at somewhere

If you want an actual MIME attachment, see /usr/ports/mail/nail


More information about the freebsd-questions mailing list