The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
su command in batch mode Rajesh Gohad Shell Programming and Scripting 3 01-25-2007 09:54 PM
AT command to batch execute every x hours naveen79 UNIX for Dummies Questions & Answers 1 08-31-2005 10:32 AM
batch command in a shell script ivvo UNIX for Dummies Questions & Answers 7 07-20-2005 06:06 AM
trying to read batch process but need some command help etravels Shell Programming and Scripting 1 11-19-2003 07:48 AM
UNIX Batch FTP Command file pietro UNIX for Dummies Questions & Answers 10 08-13-2002 02:44 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 06-10-2005
Registered User
 

Join Date: May 2005
Posts: 80
Using Batch command

Hi All

I have a need due time constraint to issue the mail command in background. I have a script that sends a message to a mail address as follows :-
echo "$MLINE" | mail -s "$HOST - $TEXT" name@co.com &

The script runs frequently and I check to see if the script is active and if it is , it will wait until there is no script running to execute completely. The problem is that due to the time it takes for the above statement to complete, I end up with a lot of waiting scripts and as such end up never executing completely.

I have pushing the command in the background, but this did not help. I have searched and found references to the batch command, but cannot get this working. We are on AIx 52.

Thx
J
Reply With Quote
Forum Sponsor
  #2  
Old 06-10-2005
Registered User
 

Join Date: Feb 2005
Location: Coimbatore, Tamilnadu, India
Posts: 119
Is your mail command working propely without any problem ?

echo "$MLINE" | mail -s "$HOST - $TEXT" name@co.com

what you are getting for this?

There may be a problem to resolve domain name and sending mail. & mode will work normally. Give your workout on this.
Reply With Quote
  #3  
Old 06-10-2005
Registered User
 

Join Date: May 2005
Posts: 80
What can I look at to identify where the bottleneck is ? I am a newbie to sendmail.
Thx
Reply With Quote
  #4  
Old 06-10-2005
DogDay's Avatar
Registered User
 

Join Date: Jun 2005
Location: /dev/null
Posts: 83
Quote:
Originally Posted by jhansrod
What can I look at to identify where the bottleneck is ? I am a newbie to sendmail.
Thx
on AIX you can check the queue with 'mailq'.

Also you can watch the send directly with something like this:

echo testing | /usr/sbin/sendmail -v root (or whatever user)

Maybe from that you can tell if its taking a long time to send the data (is it alot of data?) or having trouble eastablishing connection with the smtp server or maybe even the dns lookup.
Reply With Quote
  #5  
Old 06-10-2005
Registered User
 

Join Date: May 2005
Posts: 80
When I check the mailq, or try and send a mail out, It appears to hang and finally responds with the following :-
root@mybox#/exedir>echo "testing" | /usr/sbin/sendmail -v user@mycompany.com
WARNING: local host name (mybox) is not qualified; fix $j in config file

Thx
J
Reply With Quote
  #6  
Old 06-10-2005
Registered User
 

Join Date: May 2005
Posts: 80
This is now becoming a sendmail problem, therefore I will open another thread for this.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Tags
sendmail

Thread Tools
Display Modes




All times are GMT -7. The time now is 01:55 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0