LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-16-2005, 12:26 PM   #1
jedimastermopar
Member
 
Registered: Jun 2004
Distribution: fedora core 1 and core 2
Posts: 178

Rep: Reputation: 30
cmd line send attachment?


I am writing a script to tar a group of files andthen email it to a an account I have setup. The problem is when I use mail like this
mail -s "Backup tar" backup@mydomain.com < /var/backups/backup.tar
it puts the tar into the boy of he message. How do I get it to attach in a cmd line properly. No I don't want to start a debate on if the body is an attachment I just want to it to show up as an attachment. Thanks a bunch for reading.
 
Old 06-16-2005, 12:40 PM   #2
nixcraft
Member
 
Registered: Nov 2004
Location: BIOS
Distribution: RHEL3.0, FreeBSD 5.x, Debian 3.x, Soaris x86 v10
Posts: 379

Rep: Reputation: 30
Very easy
Use mutt command insted of mail
mutt -s "Backup tar" -a /var/backups/backup.tar backup@mydomain.com < /tmp/message

See script that mails file to gmail account http://www.cyberciti.biz/nixcraft/pr...ipts/mybackup/
 
Old 06-16-2005, 12:51 PM   #3
jedimastermopar
Member
 
Registered: Jun 2004
Distribution: fedora core 1 and core 2
Posts: 178

Original Poster
Rep: Reputation: 30
Thanks. Just figured out. also figure out you can do tack on a /dev/null for an empty body to the message.

mutt -s "Backup tar" -a /var/backups/backup.tar backup@mydomain.com < /dev/null

Thanks again though.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Sending an attachment from a command line RonnyNussbaum Linux - Software 12 06-04-2007 11:47 AM
Send excel attachment using sendmail cwseetoh Linux - Software 3 09-24-2004 01:29 PM
send mails with attachment ProXXXy Linux - Networking 2 08-18-2004 03:33 AM
howto send a mail with attachment via perl script ? cccc Programming 24 03-05-2004 07:49 PM
Send Email + Txt Attachment Using Cron Job beringer Linux - Newbie 3 01-31-2003 10:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration