Red Hat Enterprise Linux Server release 5.7 (Tikanga) - Script not sending email

The following is an extract of the script which is failing to send the email.
Red Hat Enterprise Linux Server release 5.7 (Tikanga)

TXTERROR=/home/oracle/dba/scripts/text_error.txt
cd /home/oracle/dba/logs/
ATTFILE=$ARCOUTFD
SUBJECT="Errors removing archives"
MAILTO=mail@mail.com
PARAM1=$(egrep -i -c "ORA-|rejected|Killed|skipped|RMAN-" "$ARCOUTFD")
PARAM2=$(egrep -c "Server status" "$ARCOUTFD")
PARAM3=$(egrep -c "Server status = 0" "$ARCOUTFD")
if [[ $PARAM1  -gt 0 || $PARAM2  -ne $PARAM3 ]] ; then
     (cat $TXTERROR;uuencode $ATTFILE Archive_log_error.log|mailx -m -s "$SUBJECT" $MAILTO)
fi
Solara_14TechAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

savoneCommented:
What is the error?

Also the variable $ARCOUTFD does not seem to be set.

check the /var/log/maillog also.
0
Solara_14TechAuthor Commented:
Yes it is set.  I only provide a extract of the script.
0
savoneCommented:
Well I also asked "What is the error you are getting" and did you look at the mail log in /var/log/maillog.

Also are you using postfix or sendmail?
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Solara_14TechAuthor Commented:
Thank you savone.
As you indicated I searched on the /var/mail, and this are the errors:

X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/home/oracle>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=oracle>
X-Cron-Env: <USER=oracle>


/home/oracle/dba/scripts/ARCHIVES/RMAN_ARCH_DELETE.sh: line 51: uuencode: command not found
mailx: invalid option -- m
Usage: mail [-iInv] [-s subject] [-c cc-addr] [-b bcc-addr] to-addr ...
            [-- sendmail-options ...]
       mail [-iInNv] -f [name]
       mail [-iInNv] [-u user]
0
savoneCommented:
So try changing:

(cat $TXTERROR;uuencode $ATTFILE Archive_log_error.log|mailx -m -s "$SUBJECT" $MAILTO)

to

(cat $TXTERROR $ATTFILE Archive_log_error.log|mailx -s "$SUBJECT" $MAILTO)
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Seth SimmonsSr. Systems AdministratorCommented:
uuencode: command not found

either it isn't found in the path or the sharutils package is not installed (yum install sharutils if it isn't there)

mailx: invalid option -- m

there is no m parameter (man mailx to see options)
0
Solara_14TechAuthor Commented:
Checking.
0
Solara_14TechAuthor Commented:
Thanks, it worked !
I received the email.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.