Sending a file as an email attachment using the Linux command line

1136695 pts.
Tags:
Command line
Linux
I recently created a script that's going to run every single night on my Linux server that would use 'mysqldump' to back up each of our MySQL databases to SQL files and then packaged them as a compressed .TAR files. I know want to send the .TAR file through an email to a remote email server. Here's my raw script so far:
$ cat mysqldbbackup.sql | mailx backup@email.com
I know this works but I'm looking for an easier solution. Is there a way, possibly using a Shell script, to send the compressed .TAR file to an outgoing email message?
0

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: