Skip to content
Feb 8 / Greg

Send Yourself Emails Via a Script/Cron That Attaches a File – Linux

I’m using a nice little utility called mutt.

To get this guy installed and you are running CentOS, use:

1
yum install mutt

To send yourself an email with an attachement and no text:

1
mutt -a /tmp/BackupFile.tar -s "Your backup" [email protected] < /dev/null

To send the same file but with text try this:

1
mutt -a /tmp/BackupFile.tar -s "Your backup" [email protected] <  /tmp/TextForEmail.txt

This site has some good info on mutt and the mail command.

Leave a Comment

 

*