Using Batch command


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Using Batch command
# 1  
Old 06-10-2005
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
# 2  
Old 06-10-2005
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.
# 3  
Old 06-10-2005
What can I look at to identify where the bottleneck is ? I am a newbie to sendmail.
Thx
# 4  
Old 06-10-2005
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.
# 5  
Old 06-10-2005
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
# 6  
Old 06-10-2005
This is now becoming a sendmail problem, therefore I will open another thread for this.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Batch SFTP command Help

I need to run a test SFTP command in a batch mode and what I need to prompt my password after the sftp userid@hostname. I do not have have an ssh key exchanged between my server and the external server. I only have access to it as an sftp server. I must enter my password in my script. How do i... (2 Replies)
Discussion started by: mrn6430
2 Replies

2. UNIX for Dummies Questions & Answers

Script batch with command sed

hi, i have a folder with 2000 text file where each file contain a string. i need to trasform this string like this: example of file : My name is Mark and I'm a child the new file must be: insert into tabella ('My name','My name is Mark and I'm a child'); where the first column is a... (11 Replies)
Discussion started by: yo-yo78
11 Replies

3. UNIX for Dummies Questions & Answers

Need equialent command for batch scripts

Hi Friend, what is the equivalent command for batch scripting of tail -1. for example : i have a.txt file with below the contents. i need to print last line --------------------------------- Use descriptive thread titles when posting. For example, do not post questions with subjects like... (3 Replies)
Discussion started by: Jewel
3 Replies

4. Windows & DOS: Issues & Discussions

How to call a command in a batch file?

Hi, I would like to get the output of below command emailed to me in a windows2003 server. "bpimagelist -hoursago 24 -U" I will be using "blat" to email the output of this command.But not sure how the above command is called for in a batch file when executed. Would appreciate if... (1 Reply)
Discussion started by: Hari_Ganesh
1 Replies

5. Windows & DOS: Issues & Discussions

Add password to batch command?

hello, I'd like a batch command to prompt me for a password when I try to use it, and only work if I type in the correct password, can this be done? thanks in advance. (8 Replies)
Discussion started by: Killalot57
8 Replies

6. UNIX for Dummies Questions & Answers

batch file using sed command in msdos

<! pad_meth: <! program = "/usr/lib/drivers/pse/x29d -p" how should i program it in oder to display this: <! pad_meth: <! program = "/usr/lib/drivers/pse/x29d -p" ;) (1 Reply)
Discussion started by: rita1985
1 Replies

7. Shell Programming and Scripting

su command in batch mode

Hi, how do we change user in a shell script- batch mode. Thanks, Rajesh (3 Replies)
Discussion started by: Rajesh Gohad
3 Replies

8. UNIX for Dummies Questions & Answers

AT command to batch execute every x hours

I want to schedule a batch job (SQL)to run every 6 hours in Unix and the AT command syntax does not seem to cover this. I have created a file ncd_rpt in the directory report and have given the command in this file. at -f /report/ncd_rpt 1:00 am tomorrow I schedule this by running sh... (1 Reply)
Discussion started by: naveen79
1 Replies

9. UNIX for Dummies Questions & Answers

batch command in a shell script

How do I execute a batch command from a script, which "waits" with the next command until the first one has finished? ======= A piece of my script looks like this: #!/bin/sh (...) # run a long batch job: ./run_calculation.sh # then rename resulting file: mv output.dat backup.dat (...) ... (7 Replies)
Discussion started by: ivvo
7 Replies

10. Shell Programming and Scripting

trying to read batch process but need some command help

I am trying to access batch process that take place each nite. I am using Solaris 5.8 (and i am used to redhat). however I am trying to access say a certain directory. The home/oradev , is the directory...in there i am trying to access say a batch file within this, how can see if they are in... (1 Reply)
Discussion started by: etravels
1 Replies
Login or Register to Ask a Question