Nohup Command gets status Stopped


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Nohup Command gets status Stopped
# 8  
Old 04-30-2015
Quote:
Originally Posted by alexcol
Sorry i forgot to edit shell which is:
Code:
prodstg02$ more SapInterfases.sh
/archivos/Shells/SapInterfases.sh Ingl01 20150415 3 20150415
/archivos/Shells/SapInterfases.sh Ingl01 20150416 3 20150416
/archivos/Shells/SapInterfases.sh Ingl01 20150417 3 20150417
/archivos/Shells/SapInterfases.sh Ingl01 20150418 3 20150418

Every line takes about 3 hours, so thtats why i decided to put in a nohup to run in one run and not to take idle times to wait to finish and running the next execution manually

This is the information you asked before:

Code:
HP-UX prodstg02 B.11.31 U ia64 0787399713 unlimited-user license
prodstg02$ ps
   PID TTY       TIME COMMAND
 20275 pts/9     0:00 sh
 16671 pts/9     0:00 ps

Thanks for your hel in advanced
Moderator's Comments:
Mod Comment If you continue to refuse to properly format your posts, you will be banned from The UNIX & Linux Forums.
And that doesn't tell us much about what your script is doing...

What is in /archivos/Shells/SapInterfases.sh?
# 9  
Old 04-30-2015
sorry, i apologize for my mistake, now this is the shell i wrapped

Code:
more SapInterfases.sh
/archivos/Shells/SapInterfases.sh Ingl01 20150415 3 20150415
/archivos/Shells/SapInterfases.sh Ingl01 20150416 3 20150416
/archivos/Shells/SapInterfases.sh Ingl01 20150417 3 20150417
/archivos/Shells/SapInterfases.sh Ingl01 20150418 3 20150418]

Thanks for your help in advanced

Last edited by Don Cragun; 04-30-2015 at 08:30 PM.. Reason: Fix CODE tags again.
# 10  
Old 04-30-2015
Quote:
Originally Posted by alexcol
sorry, i apologize for my mistake, now this is the shell i wrapped

Code:
more SapInterfases.sh
/archivos/Shells/SapInterfases.sh Ingl01 20150415 3 20150415
/archivos/Shells/SapInterfases.sh Ingl01 20150416 3 20150416
/archivos/Shells/SapInterfases.sh Ingl01 20150417 3 20150417
/archivos/Shells/SapInterfases.sh Ingl01 20150418 3 20150418]

Thanks for your help in advanced
That doesn't fix the mistake. I repeat:
Quote:
What is in /archivos/Shells/SapInterfases.sh?
And, what do you mean by wrapped?

Please show us (in CODE tags) exactly what is in /archivos/Shells/SapInterfases.sh and how you wrapped it when you invoked it (in CODE tags) those four tiimes.
# 11  
Old 04-30-2015
Inside the shell /archivos/Shells/SapInterfases.sh there are 4 shells that should be run sequntially day by day (by date) instead of executing each shell by the command line and wait until each shell finishes and then running the next one
so inside the shell is:
Code:
/archivos/Shells/SapInterfases.sh Ingl01 20150415 3 20150415
/archivos/Shells/SapInterfases.sh Ingl01 20150416 3 20150416
/archivos/Shells/SapInterfases.sh Ingl01 20150417 3 20150417
/archivos/Shells/SapInterfases.sh Ingl01 20150418 3 20150418

Thanks for your help and support

Last edited by Franklin52; 05-01-2015 at 07:24 AM.. Reason: fixed code tags
# 12  
Old 05-01-2015
Quote:
Originally Posted by rbatte1
If you are planning to run them sequentially, why are they being put into the background, or does the script run your commands sequentially within it?

You may need to redirect your standard error to the file too like this:-
Code:
nohup ./SapInterfases.sh 2>&1 > SapInterfases.log &

The 2>&1 redirects standard error to standard output, which you then capture in a file.



Robin
Not quite!
It redirects stderr to what stdin was. But you want
Code:
nohup ./SapInterfases.sh >SapInterfases.log 2>&1 &

The 2>&1 redirects stderr to the redirected stdout, so both go to the file.

Last edited by MadeInGermany; 05-01-2015 at 04:18 AM..
This User Gave Thanks to MadeInGermany For This Post:
# 13  
Old 05-01-2015
Quote:
Originally Posted by alexcol
Inside the shell /archivos/Shells/SapInterfases.sh there are 4 shells that should be run sequntially day by day (by date) instead of executing each shell by the command line and wait until each shell finishes and then running the next one
so inside the shell is:
Code:
/archivos/Shells/SapInterfases.sh Ingl01 20150415 3 20150415
/archivos/Shells/SapInterfases.sh Ingl01 20150416 3 20150416
/archivos/Shells/SapInterfases.sh Ingl01 20150417 3 20150417
/archivos/Shells/SapInterfases.sh Ingl01 20150418 3 20150418

Thanks for your help and support
And what is inside those?

We will repeat this as many times as needed to find out what your program is actually doing.
# 14  
Old 05-01-2015
so far i cant see its code but basically every shell extracts data from a datasource and generate a report by day by means of a tool called datastage (DSRUN). every run takes for about 3 hours, thats what i decided to include those four shells in an another shell script

Thnaks for your help and support
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help with finding the exit status of a 'nohup' command using 'PID'.

Hello All, I need to run a set of scripts, say 50 of them, parallely. I'm running these 50 scripts, from inside a script with the help of 'nohup' command. 1.The fifty scripts are stored in a separate file. 2.In a master script, i'm reading every line of the file through loop and executing... (4 Replies)
Discussion started by: SriRamKrish
4 Replies

2. Solaris

Execute the ntpdate command only when NTP daemon is stopped?

Hi, Could somebody please explain me. why is it necessary to execute the "ntpdate" command only when ntp daemon is stopped , and also the probabale solution to reduce the high offset value. Thanks !! Laxxi (4 Replies)
Discussion started by: Laxxi
4 Replies

3. UNIX for Dummies Questions & Answers

Process status for NOHUP command

Hi, I have run a shell script as a background process using 'nohup' command. I want to see the process id of this, so that I will be able to kill it later on when required. I tried to collect these details using 'ps' command and could not view this information. How do we get this... (5 Replies)
Discussion started by: Dev_Dev
5 Replies

4. AIX

Nohup command

I'm trying to run a compress script in the background, but I even though the script is running in the background I get "Sending nohup output to nohup.out." and the screen just stays there. How can I make the script run in background and make my command prompt come back. I was using: nohup... (2 Replies)
Discussion started by: NycUnxer
2 Replies

5. Shell Programming and Scripting

Why the nohup-ed background process always is "stopped" ?

I let a script A call script B. I used nohup a.sh &>/tmp/log & In script A it calls B directly, without any redirecting or nohup or background. However A is always "Stopped", while B is running correctly. Anybody knows why? thanks! -----Post Update----- BTW, if I don't use nohup... (4 Replies)
Discussion started by: meili100
4 Replies

6. UNIX for Advanced & Expert Users

Why the nohup-ed background process always is "stopped" ?

I let a script A call script B. I used nohup a.sh &>/tmp/log & In script A it calls B directly, without any redirecting or nohup or background. However A is always "Stopped", while B is running correctly. Anybody knows why? thanks! -----Post Update----- BTW, if I don't use nohup... (1 Reply)
Discussion started by: meili100
1 Replies

7. UNIX for Dummies Questions & Answers

nohup command..

Hi.. Can anybody tell me, what exactly the nohup command does & when is it used? Your help is appreciated. (3 Replies)
Discussion started by: Amol21
3 Replies

8. UNIX for Dummies Questions & Answers

Problem with nohup command

Hello folks, I have got a script which telnets to different boxes and runs a certain script with 3 run time args. The line from the script which does it is: (sleep 1; echo $USERID ; sleep 1; echo $PASSWD ; sleep 1 ; echo y ; sleep 1 ; echo "\r" ; sleep 1 ; echo "cd $FILEPATH" ; sleep 1 ; sleep 1... (1 Reply)
Discussion started by: Rajat
1 Replies

9. Shell Programming and Scripting

What's the command for nohup in Oracle

Hello, I need running the process from Oracle in backround. Thank you for your help. C.Abarca (1 Reply)
Discussion started by: cabarcaj
1 Replies

10. UNIX for Dummies Questions & Answers

Nohup Command

Hello All, I am newbie to unix.I am trying to use NOHUP command in shell script it works fine with only "nohup test.sh 10 &" and "/opt/user/nohup test.sh 10 &" gives an error saying "ksh: /opt/user/nohup : not found". Can anybody please guide me to make it work. Thanks Blazix (9 Replies)
Discussion started by: blazix
9 Replies
Login or Register to Ask a Question