red Posted November 25, 2004 Report Share Posted November 25, 2004 Hiya folks, I spent the last 2 days, with no luck, trying to find a script that will send an e-mail from a simple shell script. What I want to happen is for my simple backup script to drop an e-mail to me when it has completed. My backup is working fine from the script, but when sending the e-mail, using: "mail -s <Subject> <recipient> " it hangs waiting for output for the actual message, then with a "Cc:" prompt waiting for more keyboard input for a CC recipient then it requires a "Ctrl-D" to actually send. How can I get this all to work in one fell swoop or have the script imitate the keyboard input. Thanks, RED Quote Link to comment Share on other sites More sharing options...
Qchem Posted November 25, 2004 Report Share Posted November 25, 2004 echo Backup completed on `date +%d-%m-%y` | mail -s "Foo backup" bar Is what I call from a cron script to do something similar, Foo being the name of the machine and bar being the user I want to send it to. Quote Link to comment Share on other sites More sharing options...
red Posted November 25, 2004 Author Report Share Posted November 25, 2004 Thats it!! Thanks Much! RED Marked the thread Solved - Artificial Intelligence Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.