[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [cobalt-users] OT: [raq3] How to mail a binary file through a script



Hello

Check this link:
http://www.shelldorado.com/articles/mailattachments.html

>===== Original Message From cobalt-users@xxxxxxxxxxxxxxx =====
>Hello...
>
>I am not experienced at writing scripts, but I can put together a basic
>shell script.  What I want to do is have the compressed access log file
>mailed to me automatically.
>
>In my logrotate script, I have the log files mailed to me prior to being
>expunged so that I can archive them.
>
>In logrotate, I am using the compress option and the mail option. Before
>mailing, logrotate it seems uncompresses the compressed log file. This is
>fine for most log files except access which exceeds the mail size limit when
>uncompressed. I don't want to increase the mail size to the amount necessary
>to accomodate the uncompressed file as this would apply serverwide.
>
>What can I use in a shell script that will mail the compressed (gz) file?  I
>have tried 'mail admin < /path/access.1.gz', but it sends the file as
>'text'. I have tried 'pine admin -attach /path/access.1.gz', which will mail
>the file as an attachment, but pine is waiting for the "CTRL-X" send
>command.