LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Error while sending mail with mailx (https://www.linuxquestions.org/questions/linux-newbie-8/error-while-sending-mail-with-mailx-4175571972/)

starqazi 02-11-2016 05:12 AM

Error while sending mail with mailx
 
Hi All,

I am getting following error while sending mail with mailx through shell script.

*********************
temporary mail file: No such file or directory
*********************

Permission for /tmp given below:

drwxrwxrwt. 18 root root 4096 Feb 11 16:07 tmp

Size for /tmp is:
80K tmp

Waiting for your kind and immediate response.

Regards,
Qazi Mohammad Shahnawaz

TB0ne 02-11-2016 07:30 AM

Quote:

Originally Posted by starqazi (Post 5498503)
Hi All,
I am getting following error while sending mail with mailx through shell script.

*********************
temporary mail file: No such file or directory
*********************

Permission for /tmp given below:
drwxrwxrwt. 18 root root 4096 Feb 11 16:07 tmp

Size for /tmp is: 80K tmp

Waiting for your kind and immediate response.

We volunteer our time here...if you need an 'immediate response', then your best course of action would be to hire someone. Otherwise, asking for/expecting 'immediate' help is fairly rude. Also, you need to read the "Question Guidelines" link in my posting signature, because unless you provide actual DETAILS, there is nothing we can tell you. You don't tell us what version/distro of Linux, post your shell script, or really give us anything to go on.

Also, since you need 'immediate' help, did you try just putting that error into Google, along with the "mailx" term??? Because it pulls up LOTS of information, and tells you exactly why you're getting that message, and how to fix it.

starqazi 02-11-2016 11:39 PM

Linux version and Shell script
 
Thanks for response.

My linux version is:

Linux XXXXXXXXX 2.6.32-504.23.4.el6.x86_64 #1 SMP Tue Jun 9 08:39:04 PDT 2015 x86_64 x86_64 x86_64 GNU/Linux
*************************************************************
My Shell script is:

#! /bin/ksh
prog=`echo $0 | sed 's/.*\///g;s/\.sh//g'`.sh # extract script name
prog1=`echo $0 | sed 's/.*\///g;s/\.sh//g'`
HOST=`uname -a | awk '{print $2}'`; export HOST

export ORACLE_SID=$1
export ORACLE_HOME=$2
export SCRDIR=$dba_bin
export cur_date=$(date +%d/%m/%y)
stamp=`date +%m/%d@%H.%M`
echo "Begin time: `date`"

DBA_LIST=`grep dba_ei $dba_config/.ob_config.env | cut -d= -f2`
MsgFile=$mon_log'/'$prog1'_'$ORACLE_SID.msg

function WarnMes
{
echo $stamp
echo $stamp >$MsgFile
ScriptLoc='Script - '$HOST':'$SCRDIR'/'$prog
echo $ScriptLoc
echo $ScriptLoc >>$MsgFile
echo ' ' >>$MsgFile
echo $MSG
echo $MSG >>$MsgFile
}




users_pwd=$dba_config/jobs.ctl
DBAUSER=`grep DBA_$ORACLE_SID= $users_pwd | cut -d= -f2`
###################################################################################
#Get a dump of all the indexes where owner is SCOTT
###################################################################################

#${ORACLE_HOME}/bin/sqlplus /nolog << EOF
#connect $DBAUSER@$ORACLE_SID
${ORACLE_HOME}/bin/sqlplus $DBAUSER@$ORACLE_SID @$dba_sql/check_alert_errors.sql
if [ -s $mon_log/alert_errors.lst ];
then
WarnMes
echo " Following Errors/Warnings found in Alert Log File for $ORACLE_SID: on $HOST on $cur_date" >>$MsgFile
cat $mon_log/alert_errors.lst >>$MsgFile
cat $MsgFile | mailx -s 'Errors/Warnings found in Alert Log for '$ORACLE_SID' on '$HOST' on '$cur_date'' $DBA_LIST

else
WarnMes
echo "No Errors found in Alert log File for instance $ORACLE_SID on $cur_date' >> $MsgFile
fi


echo "End time: `date`"

*****************************************************************

Thanks & Regards,
Qazi

TB0ne 02-12-2016 01:11 PM

Quote:

Originally Posted by starqazi (Post 5498992)
Thanks for response.
My linux version is:

Linux XXXXXXXXX 2.6.32-504.23.4.el6.x86_64 #1 SMP Tue Jun 9 08:39:04 PDT 2015 x86_64 x86_64 x86_64 GNU/Linux

No, that's the kernel version. Version/distro of Linux is just that...something like "CentOS 6.5" or "Mint 17". This tells us nothing.
Quote:

*************************************************************
My Shell script is:
...not in CODE tags, and is hard to read without them. And it also doesn't matter, since you haven't apparently tried to look up the error, as it was suggested you do.

AGAIN did you try to look up the error???? You're not setting a TMPDIR variable in your script, and you say that /tmp is 80K?? That's tiny, so redirect it somewhere else.


All times are GMT -5. The time now is 05:41 AM.