Script Not waiting....plz help


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Script Not waiting....plz help
# 1  
Old 06-16-2008
Script Not waiting....plz help

Hi All:
I am trying to call a multi-step script from a script.
here is the code

Code:
#!/usr/bin/ksh

util.sh <<EOF
 connect 
 dump
EOF

I am able to run the script but it is disconnecting before the dump job is finished. The script util.sh does not provide any functionality to wait till the job is finished. Is there a way in ksh to wait till the job is done?
# 2  
Old 06-16-2008
Question Can this be looked at differently?

A couple of thoughts based on what you provided:
(a) Can you issue those two commands manually? Does the connect "time-out" anyway during the dump?
(b) How big is the dump? Is it possible that the dump is error'ing, perhaps by filling available space or exceeding some quota? This could give the impression that the connect is timing-out; but in fact the dump would be causing the problem.
# 3  
Old 06-16-2008
joey thanks for the reply.

the individual commands run till the jobs are done.

if i run the commands individually, after connect it will lead to a console and wait until exit is issued. For the dump command, it will wait till the job is finished.

But when run through the above code, even the connect is closing the session after a while. This could be related to the shell behavior.
# 4  
Old 06-17-2008
any ideas...plz suggest something
# 5  
Old 06-17-2008
Question does it disconnect at a known value?

In other words,
(a) does the dump end at exact/about the same filesize?
(b) does the dump end after similar amounts of elapsed time?

Run a couple of times and see what the pattern is.
(a) could mean exceeding some threshold: filesize, allocation, available space
(b) general time-out; think of a screen-saver that blanks a screen even though a program is running since it has not sensed keyboard entry in xx time.
# 6  
Old 06-17-2008
Joey:
As I mentioned in my previous post: The script when run alone, after connect it will wait until the "exit" command is issued. So when we run the dump, it is producing 10MB file (this is expected size).

When I try to automate using shell script: the dump disconnects and the size I am getting is random, between 4-5MB.

Also, I tried
Code:
#!/usr/bin/ksh

util.sh <<EOF
 connect 
EOF

and even this code disconnects after a while(after executing connect), but when I run the util.sh standalone, after connect it wait indefinitely for the commands and will exit when the exit command is issued. So this means that the Shell is disconnecting.

There might be a way to wait until the job is done.

Please note that I can not change "util.sh" as it is using Java classes and it is supplied by vendors.
# 7  
Old 06-17-2008
Tools Can you time-it?

Do you get a message on disconnect? Or do you just know 'after' since you see it aborted? Since the file is building to simlar size range, I am lef to wonder if there is some time-out on batch at 900 seconds or other value.
So, can you see if three failures all occur about the same timeframe? If so, then this may be the 'cause' of the matter.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to break out of hung or waiting telnet session in shell script?

I have to put together telnet instructions for 100s of hosts for verifying basic connectivity and get output in a neat format. Problem- If a telnet is hung with message "Trying .... <hostname" due to firewall or routing issue the commands waits for a very long time before it times out and my... (2 Replies)
Discussion started by: desiphantom
2 Replies

2. Shell Programming and Scripting

Waiting for a process to complete in shell script

Hi, I need to initiate a process script which will start and do some processing and then shuts down. Then i need to other verifications. But the the process takes around 25 to 3o minutes. One thing i can monitor the nohup.out file for this process where i can wait for shutting down statement to... (3 Replies)
Discussion started by: Prashanth19
3 Replies

3. Windows & DOS: Issues & Discussions

AutoSys Job not waiting for script to complete

I'm not sure if this is the right place to post this issue...but here goes... I am converting a set of windows jobs from Control-M to AutoSys r11.3. The same command line is being executed in both systems. The Control-M job runs to compltion in about 1.5 hours, waiting for the entire batch... (3 Replies)
Discussion started by: ajomarquez
3 Replies

4. Shell Programming and Scripting

How to do this Script PLZ?

HI all , i want to make an automatic script using if / while to search for files in folder and get the least by date and gzip them ( last 70 file ) /file/home/logs 30 files in 11/2012 45 files in 10/2012 30 files in 9/2012 10 files in 8/2012 so it get 10 + 30 + 30 ( from 10 )... (5 Replies)
Discussion started by: teefa
5 Replies

5. Shell Programming and Scripting

Need Script plz help

hi please help i need script to merger columns input file a,bb,1234345234 a,bb,sdfsdfsdf a,bb,xxxxxxxx b,cc,12335353 b,cc,fdgfdghht b,cc,yyyyyyy c,22,sdfgsdfg . . . . output file a,bb,1234345234a,bb,sdfsdfsdfa,bb,xxxxxxxx (10 Replies)
Discussion started by: ragu.selvaraj
10 Replies

6. Shell Programming and Scripting

SQL PLUS Command 'ACCEPT' is not waiting for user input with sh shell script

Dear All, The sqlplus 'Accept' command is not waiting for user input when I include the command within a shell script. Note: The 'Accept' command is working fine if I execute it in a SQLPLUS Prompt. Please fins the below sample script which i tried. SCRIPT: -------- #!... (4 Replies)
Discussion started by: little_wonder
4 Replies

7. Shell Programming and Scripting

expect script hangs while waiting for the flag...

I am writing a script to check whether the root password is set to a special string on some solaris servers. Normally, the manually ssh login session is as below: $ ssh root@host1 Password: Last login: Wed Sep 16 13:53:28 2009 from 10.1.102.13 Sun Microsystems Inc. SunOS 5.10 ... (4 Replies)
Discussion started by: sleepy_11
4 Replies

8. Shell Programming and Scripting

script help plz

Hi, im trying to make a script which will look up every .c file in the current directory for the strings printf or fprintf. if found, the script adds the statement #include <stdio.h> at the beginning of the file but only if it doesnt alrdy have it included. How do i do that ?i know firstly, i need... (6 Replies)
Discussion started by: lohan
6 Replies

9. Shell Programming and Scripting

Script not waiting for user responce

hi all, Im fairly new to scripting and am having a noobish issue. Ive got a script that checks for certain directories and if they dont exist, prompts the user to do a mkdir. heres trouble spot in the script: cat dirlsttemp.dat | while read dir; do echo "$dir does not exist, would you... (3 Replies)
Discussion started by: rdudejr
3 Replies

10. UNIX for Dummies Questions & Answers

plz Help How should I configure cc compiler output file plz help???

i.e configuration of C compiler :confused: (4 Replies)
Discussion started by: atiato
4 Replies
Login or Register to Ask a Question