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)

cd /home/oracle/dba/logs/
SUBJECT="Errors removing archives"
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)
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

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.

What is the error?

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

check the /var/log/maillog also.
Solara_14TechAuthor Commented:
Yes it is set.  I only provide a extract of the script.
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?
Acronis True Image 2019 just released!

Create a reliable backup. Make sure you always have dependable copies of your data so you can restore your entire system or individual files.

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/ 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]
So try changing:

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


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

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)
Solara_14TechAuthor Commented:
Solara_14TechAuthor Commented:
Thanks, it worked !
I received the email.
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

From novice to tech pro — start learning today.