Link to home
Start Free TrialLog in
Avatar of bushmannt
bushmannt

asked on

mailing .gz files from shell scripts

I'm trying to mail myself gzipped logs.  
The problem is that when I you do

cat log.gz | mail -s logs myaddress@domain.com

the file gets garbled because it contains unprintable characters.
I don't want to uuencode it, becuase it has to be uudecoded on the other end.  All I want is a simple, automated way to get these files to a normal windows box, if it was unix there's a lot more tricks.
Any ideas?  I'm confused, even though it seemed like a simple question.
thanks,
Marcin

AIM:  bushmannt
ASKER CERTIFIED SOLUTION
Avatar of yuzh
yuzh

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bushmannt
bushmannt

ASKER

I tried pine, but even when I give it all the needed info (address, subject, attachment file) it still goes into interactive mode.  do you know how to solve that one?
pine is a screen-oriented message-handling tool. It is not design to use for commandline.

You can try to write a script to force it to run in command, but you need to record all your key stroks, from starting of ping to exit from it.

eg:

#/bin/ksh
echo "use ping to send attachment file, ...."
(
pine <<EOF
#all the key stroks goes in here, one action per line !
...
...
EOF
) > /dev/null
exit
#   End

you can also use "mpack" to do the job in command, example can be find:

http://www.murkworks.net/helpfiles/mime.html

"mpack" is free, once you get it installed, do
man mpack

to learn more.

just remember you still have mutt, mpack as the alternatives.
mutt works!
i did:

echo "hello" | mutt -a file.gz -s "logs" user@address.com

and it all came out the other end as a proper attachment.
THANKS!
You are welcome, cheers!