sending mail
I need to setup mail confimations about the cron jobs executed the previous night stright into my inbox.
I am using mailx in the script which the cron executes. I get errors like,
/usr/bin/mailx -s log report -c shankie@vtech.org -f /u06/oslog/prod.log
The flags you gave are used only when sending mail.
Where am i missing the link?
[365 byte] By [
shankie] at [2007-11-26 8:39:57]

# 1
> /usr/bin/mailx -s log report -c shankie@vtech.org -f
> /u06/oslog/prod.log
> The flags you gave are used only when sending mail.
Showing exactly how the mail line appears in the script rather than just the error would probably be helpful.
But I don't see any quotes around your subject and I'm not sure why you're using the -f flag. '-f' specifies what mailbox you want to open for reading.
--
Darren
# 2
I dont see any errors in the log. I pasted the lines from script but it did not show up here.
This is how i exactly place them in my shell script.
/usr/bin/mailx -s "log report" -c "shankie@vtech.org" -f "/u06/oslog/prod.log"
Options listed in man pages is so confusing. so i should not use -f for the file to send in mail, and as below:
mailx -s "log report" -c "shankie@vtech.org" "/u06/oslog/prod.log"
# 3
Haven't finished my first cup of coffee yet, but try:mailx -s "log report" -c "shankie@vtech.org" < "/u06/oslog/prod.log"Note the redirect.
# 4
I get this error when i execute from command line.The flags you gave are used only when sending mail.Usage: mailx -eiIUdFntBNHvV~ -T FILE -u USER -h hops -r address-s SUBJECT -f FILE usersDoes it mean i should use only in a script file.
# 5
> I get this error when i execute from command line.
>
> The flags you gave are used only when sending mail.
> Usage: mailx -eiIUdFntBNHvV~ -T FILE -u USER -h hops
> -r address
>-s SUBJECT -f FILE users
> should use only in a script file.
Showing the error doesn't help much in this case. You also need to show what you are doing. Post the actual command you are executing.
--
Darren
# 6
mailx -s "log report" -c "shankie@vtech.org" < "/u06/oslog/prod.log"
# 7
Confirming once again to the user community.
I need a mail confirmation to my outlook inbox for the job completed by the shell script scheduled in cron. For this i use mailx and the command as given above.
I have scheduled this job(cron) which runs at 10pm every night.
Can some one brief me what is the difference between mailx and sendmail?
Thanks!
# 8
Forget to add i am running the mailx as user Oracle.
# 9
> mailx -s "log report" -c "shankie@vtech.org" < "/u06/oslog/prod.log"
-c is for someone to be cc'd on the message. You need to supply a recipient (or multiple recipents) besides the cc list.
If shankie@vtech.org is the only recipient, ditch the '-c'.
(And while I saw the error message post, I misinterpreted your earlier post with the command line in it. Sorry about that.)
--
Darren
# 10
> Can some one brief me what is the difference between
> mailx and sendmail?
mailx is a local utility that tries to deliver a message and a recipient list to a mailer. It's what you should be running to send a text message.
Sendmail is a Mail Transport Agent (MTA) which runs to deliver mail on the request of programs. Sendmail (or some other MTA) needs to be at least minimally configured so that mailx can work.
--
Darren
# 11
Thanks Darren. (you need not to be sorry about that it happens you see unknowingly)So i shall go formailx -s "log report" "shankie@vtech.org" < "/u06/oslog/prod.log"and this should work well. let me execute this and post it if i still have errors.
# 12
Well this one works and sends the mail to the Oracle users inbox at the server.I need this to be sent to my outlook inbox through mail. how shall i go about this. should i use sendmail?
# 13
Your outlook users should have a normal SMTP email address. Just send it to the correct address.-- Darren
# 14
It ignores the address "shankie" and goes to login users mailbox!!mailx -s "log report" "shankie@vtech.org" < "/u06/oslog/prod.log"Is there any services which should be running?Thanks.