Unix mail to personal mail, Strange behavour


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Unix mail to personal mail, Strange behavour
# 1  
Old 05-28-2009
Unix mail to personal mail, Strange behavour

Hi.

I am running a script on solaris 10 and mailing it to my personal email.

the script is ran as user xxx, And i have edited the crontab for user xxx to run the script and mail it to my email account.

/network_check.sh | /usr/bin/mailx -s "Network Test" k454@hotmail.com

the sript runs fine outside of crontab and email the expected output.

i.e.
TUcron reported errors for server:
tjob_20090528-0300.log

the script touchs a few tmp log files and then cleans up.


However when i run the script with crontab it executes the script and

TUcron reported errors for server:
::::::::::::::
/var/tmp/logTU.txt
::::::::::::::
tjob_20090528-0300.log

the script finishes, however it doesnt remove any of the log files that were generated in the cleanup stage of the script. and it outputs

:::::::::::::

::::::::::::: at the point when the log files are being generated by the script in crontab dont know what it is referring to, Can anyone help
# 2  
Old 05-29-2009
Please post the line from crontab, the contents of the script, and state which shell is running for user xxx.
# 3  
Old 05-29-2009
the line from the crontab is:

03 17 * * * /network_check.sh | /usr/bin/mailx -s "Network Test" k454@hotmail.com

the sh i am running the script in is:
#!/bin/sh


in the script i log onto two servers checking logs. on the server i am running the scripts in its directory i create temporary log files, and remove them at the cleanup stage of the script, This mailx works perfect outside of crontab in crontab it seems to have some problem while it is creating the tmp .txt files.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Client was not authenticated to send anonymous mail during MAIL FROM (in reply to MAIL FROM comm

I am having trouble getting mail to work on a red hat server. At first I was getting this message. Diagnostic-Code: X-Postfix; delivery temporarily suspended: connect to :25: Connection refused Then added the port to my firewall. Then I temporarily turned off selinux. I then copied this file... (1 Reply)
Discussion started by: cokedude
1 Replies

2. UNIX for Advanced & Expert Users

How can I send a mail from my outlook or other mail accounts to UNIX server?

Hi all, I want to send a mail for my business needs from outlook account to an unix server (HP-UX) but I don't send any mail. While I can send from the unix server to my outlook account, I can't send from outlook to unix. How can I achieve this ? How can I send a mail from my outlook or other... (2 Replies)
Discussion started by: igelegin
2 Replies

3. Red Hat

strange mail behavior

Hi I have script to to take backup and send mail to a group once a day. One strange behavior I have observed recently is that most of the time the mail we receive is fine . But someday it just sends out mail without any subject with undisclosed recipients. I dont know how to find the cause... (0 Replies)
Discussion started by: ningy
0 Replies

4. Cybersecurity

How can i secure my personal data and E-mail id?

Today the problem of hacking is increasing day by day so in this situation how can i secure my personal data and E-mail id? Please reply me soon. (1 Reply)
Discussion started by: andrepitt77
1 Replies

5. UNIX for Advanced & Expert Users

need to configure mail setting to send mail to outlook mail server

i have sun machines having solaris 9 & 10 OS . Now i need to send mail from the machines to my outlook account . I have the ip adress of OUTLOOK mail server. Now what are the setting i need to do in solaris machines so that i can use mailx or sendmail. actually i am trying to automate the high... (2 Replies)
Discussion started by: amitranjansahu
2 Replies

6. UNIX for Advanced & Expert Users

How to relay mail to mail server from Unix ?

Hi, I need to send email notifications from Unix/Linux box to users using mailx. In these Unix/Linux boxes mail is not configured however we are having mail server configured in our LAN. Could you please provide instructions to configure relay in these boxes so that we can relay our mails... (3 Replies)
Discussion started by: sourabhsharma
3 Replies

7. Shell Programming and Scripting

Shell script for sending automatic email to personal mail id

hi guys, I need a shell script to send mail automatically to my personal mail id like xxxx@hotmail.com but while experimenting with "mail" command I faced following problems. cat text1.txt | mail -s 'test mail' xxxx@hotmail.com command successfully executed but while checking for... (4 Replies)
Discussion started by: rrd1986
4 Replies

8. Solaris

how to forward mail in /var/mail/username to external mail

Dear All, Now I use solaris 10 and I try to forward mail from /var/mail/username to their external mail so what should I do? thank u in advance (2 Replies)
Discussion started by: unitipon
2 Replies

9. UNIX for Dummies Questions & Answers

I am not able to send mail form unix to other mail accounts.

Using Mailx command i.e mailx -s "subject" chinni@hotmail.com < \tmp\chin this command executed sucessfully but not able to receive the mail in chinni@hotmail.com please help. (1 Reply)
Discussion started by: chinnigd
1 Replies

10. UNIX for Dummies Questions & Answers

can not send mail from unix server to company/yahoo mail

hi, Gurus, I need some help with sending mail out from my UNIX server: It is running Solaris 2.6 and the sendmail version is 8.8. Output of :/usr/lib/sendmail -d0.1 -bt < /dev/null Version 8.8.8+Sun Compiled with: LOG MATCHGECOS MIME7TO8 MIME8TO7 NAMED_BIND NDBM NETINET ... (5 Replies)
Discussion started by: b5fnpct
5 Replies
Login or Register to Ask a Question