If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > Why my script is always "stopped" ?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-27-09, 00:49
meili100 meili100 is offline
Registered User
 
Join Date: May 2009
Posts: 1
Question Why my script is always "stopped" ?

This is the problem that drives me crazy. I let a script A (a.sh) call script B (b.sh).
I used
Code:
 nohup a.sh &>/tmp/log &
In script A it calls B directly, without any redirecting or nohup or background.

Script A:
Code:
#do nothing but call B
ssh another-machine "/user/tom/b.sh"
Script B:
Code:
# do some fancy things, takes about 1 hour to finish
...
I used
Code:
nohup a.sh &>/tmp/log &
It was "stopped" after 5 minutes but B was running and B finished correctly.

Anybody knows why?

BTW, if I don't use nohup and backgrounding, it's OK. i.e. if I use
Code:
a.sh
directly. Everything is OK. I am totally confused.
Reply With Quote
  #2 (permalink)  
Old 06-01-09, 11:17
LKBrwn_DBA LKBrwn_DBA is offline
Registered User
 
Join Date: Jun 2003
Location: West Palm Beach, FL
Posts: 2,455
Cool Waiting..

In nohup or background it is 'stopped' waiting for the ssh to complete.

In foreground, it just 'waits' for a command (v.g break) from terminal input while waiting for ssh to complete.
__________________
The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On