Operating System - HP-UX
1848585 Members
4615 Online
104033 Solutions
New Discussion

Re: elm standard error/output from script

 
SOLVED
Go to solution
Nick Lewers
Advisor

elm standard error/output from script

hpux 11i 64bit

I have a cron'd backup script that backs up some files as root then emails the log to a couple of people -
here is what i get back from cron:
&f1k16d-1L &f2k16d-1L &f3k16d-1L &f4k16d-1L &f5k16d-1L &f6k16d-1L &f7k16d-1L &f8k7d1L Cancel&s1A&jB&jR&f1k16d-1L &f2k16d-1L &f3k16d-1L &f4k16d-1L &f5k16d-1L &f6k16d-1L &f7k16d-1L &f8k7d1L Cancel&s1A&jB&jR&f1k14d1L Display Msg&f2k14d1L Mail Msgm&f3k15d1L Reply to Msgr&f4k14d1L Save Msgs&f5k14d1L Delete Msgd&f6k14d1LUndelete Msgu&f7k14d1L Print Msgp&f8k14d1L Quit ELMq&s1A&jB&jR&s1A&jB&jR&s0A&j@&f1k16d-1L &f2k16d-1L &f3k16d-1L &f4k16d-1L &f5k16d-1L &f6k16d-1L &f7k16d-1L &f8k7d1L Cancel&s1A&jB&jR&f1k16d-1L &f2k16d-1L &f3k16d-1L &f4k16d-1L !
&f5k16d-1L &f6k16d-1L &f7k16d-1L &f8k7d1L Cancel&s1A&jB&jR&f1k14d1L Display Msg&f2k14d1L Mail Msgm&f3k15d1L Reply to Msgr&f4k14d1L Save Msgs&f5k14d1L Delete Msgd&f6k14d1LUndelete Msgu&f7k14d1L Print Msgp&f8k14d1L Quit ELMq&s1A&jB&jR&s1A&jB&jR&s0A&j@

*************************************************
Cron: The previous message is the standard output
and standard error of one of your crontab commands:

/usr/glsbin/filebu.sh

this looks like the standard elm menu, so I am assuming that is where the problem is - anyone have any thoughts on why I'm getting this? this is the elm command at the end of the script:
for names in $mailist
do
cat $bklog | elm -s "File Archive $host" $names >/dev/null
done

Thanks, Nick
9 REPLIES 9
S.K. Chan
Honored Contributor

Re: elm standard error/output from script

Try ..
elm -s "File Archive $host" $names < $bklog
instead
Craig Rants
Honored Contributor

Re: elm standard error/output from script

Try this format instead.

elm -s "Suject" user@domain.com < filename

GL,
C
"In theory, there is no difference between theory and practice. But, in practice, there is. " Jan L.A. van de Snepscheut
Uday_S_Ankolekar
Honored Contributor
Solution

Re: elm standard error/output from script


Hi,

Try using mailx instead of elm..

mailx -s "subject here" alias list < $logfile.

aliaslist would be the list of users who should get this mail and can be configures in /etc/mail aliases file

Goodluck,
-USA..
Good Luck..
Nick Lewers
Advisor

Re: elm standard error/output from script

thanks - ill try redirecting the other way a try. Nick
A. Clay Stephenson
Acclaimed Contributor

Re: elm standard error/output from script

If you are running elm in a non-interactive environment, you must first create a .elm directory in the sender's home directory. It can be an empty directory but should have 700 permissions. Just to be safe, I would also create a 'Mail' directory with 700 permissions as well. Of course, all the other precautions apply as well. Make sure that every command in
your script under cron either is fully pathed or that PATH is properly set.
If it ain't broke, I can fix that.
Nick Lewers
Advisor

Re: elm standard error/output from script

the mail directory exists and has the proper permissions. the funny thing is, this script worked fine on 10.20 32 bit (dont know if the sendmail version changed or not, or elm for that matter with 11i), so that's why I'm a bit perplexed. thanks for the replys, I'll let you know how it turns out.
Nick Lewers
Advisor

Re: elm standard error/output from script

the .elm directory also exists, and the file permissions are correct - sorry forgot to mention that (must be first post jitters i guess)
Deshpande Prashant
Honored Contributor

Re: elm standard error/output from script

HI
The following command will send the log file as attachment in email.
For multiple people to receive it use mail aliases by defining it in /etc/mail/aliases file.

#/usr/bin/uuencode |mailx -m -s

Thanks.
Prashant.
Take it as it comes.
Nick Lewers
Advisor

Re: elm standard error/output from script

well, redirection the other way didnt work (<), but mailx worked just fine - thanks for the responses, Nick