Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automated mails

Status
Not open for further replies.

YO123

MIS
Jul 26, 2001
77
BE
In our system there are some error files that are generated when a process from a programm does not work.
The problem is that every 5 minutes the error file copies itself in another directory, which could fill up the system.

Now I'm trying to set up a script that run's every 5 minutes that checks if there is an error file in that directory and that mails me when there is.

My problem is now that the mail is not send without a body. I already have the mail ready to send with a header, but I still have to enter a body text and and ending (.) to have the message sent out.

How can I automate this so that there is only a subject line?

TNX

YO
 
Which OS are you using? "Standard" *nix boxes such as Solaris or HP/UX have the mailx command:
[tt]
cat /path/to/error/file | mailx -s"An error file subject line"
[/tt]
Under Linux you could install "mutt", if mailx is not available:
[tt]
cat /path/to/error/file | mutt -s"An error file subject line"
[/tt]
Or
[tt]
echo "The attached file is your error file" | mutt -s"An error file" -a /path/to/error/file
[/tt]
Hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top