[wellylug] Problem with attachment
Spiro Harvey
spiro at starforge.net.nz
Wed Mar 4 11:30:16 NZDT 2009
On Wed, 4 Mar 2009 10:58:25 +1300
"Peter Lynch" <Peter.Lynch at acc.co.nz> wrote:
> I have the following script which runs daily on my Debian Lenny
> server.
>
> #! /bin/bash
>
> export maildate=`date --date=yesterday +'%h %e'`
> sudo less /var/log/mail.log | grep "$maildate" > mail.txt
> uuencode mail.txt mail.txt | mail -s "Mail log" xxx at xxx.co.nz
>
> When I view the mail through SquirrelMail (version 1.4.15), it does
> not recognise the file as being an attachment. It simply displays
> this:
seems that uuencoding has gone the way of the dodo..
I had written in simple updates, but it's better if I just give you
this:
#!/bin/bash
maildate=`date --date=yesterday +'%h %e'`
sudo grep "$maildate" /var/log/mail.log | mail -s "Mail Log"
xxx at xxx.co.nz
optionally, I would make the email subject something like
"Mail Log $maildate"
--
Spiro Harvey
UNIX Specialist, Writer, Editor
http://twiddle.starforge.net.nz
Give us this day our garlic bread and lead us not into vegetarianism
but deliver us some pizza.
+++
ATH0
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
Url : http://lists.wellylug.org.nz/pipermail/wellylug/attachments/20090304/f638fca6/attachment.pgp
More information about the wellylug
mailing list