Results 1 to 3 of 3
I have written a script which runs a simple program in the background, logs the output and emails me when the job is done. It works fine except for the ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 06-20-2012 #1
- Join Date
- Jun 2012
Help with a script
1) I can try the "tee" command, but i have never used this
2) Some email services wont accept email when the sender is not specified
This is the code i have for sending the email:
(nice -n 10 nohup ./$user_cmd >$log_stdout 2>$log_stderr </dev/null ; echo $body `date` | mutt -s "$subj" $recipient) &
Can someone please help me get this working properly. I am using fedora which uses the "mutt"command instead of mail.
- 06-20-2012 #2
- Join Date
- May 2011
- Central FL
1) Do you have a working mail server running on this machine? (sendmail, postfix, etc)
2) Can that mail system even deliver mail locally (from your server TO your server, not to anything remote)
3) Have you properly configured that mail server?
4) Do you have a correct DNS and Reverse DNS entries for this mail server?
5) Is your firewall set correctly to allow the outgoing mail?
Nothing with your script is going to matter at all (as far as sending mail to a remote server) until you get the above corrected.
- 06-21-2012 #3
I guess it depends on who runs the script, you can try manipulating muttrc: MuttWiki: MuttFaq/Header
Never really used mutt, I always installed sendmail, and used something like:
( echo "To: $EMAIL" echo "From: $FROM" echo "Subject: $SUBJECT" echo "$BODY" ) | /path/to/sendmail $EMAILlinux user # 503963