How do I send output of a background process to a file other than nohup.out?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How do I send output of a background process to a file other than nohup.out?
# 1  
Old 10-15-2013
How do I send output of a background process to a file other than nohup.out?

I have a question.

I will be running a background process using nohup and & command at end. I want to send output to a file say myprocess.out.

So will this command work?

Code:
nohup myprocess.ksh > myprocess.out &

Thanks in advance guys !!!

Smilie

Last edited by Scott; 10-15-2013 at 12:22 PM.. Reason: Code tags
# 2  
Old 10-15-2013
You can answer this question yourself with a simple, brief experiment using date, echo, or any other short-lived command which generates output.

Regards,
Alister
# 3  
Old 10-15-2013
Note that you may get into some trouble trying to use nohup in cron (if you plan to do so)
(check the link of post #2 in this thread )
# 4  
Old 10-15-2013
Thanks guys.

Actually I was running a vendor supplied script and it writes output to another location within script. So that is the resaon I was not seening any output.

I tested with simple echo commands in a sample script and that gets redirected correctly.

Smilie
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Nohup not give expected output. Non-stop running process

Hello, I am trying to make a bash script, I tested nohup but it did not help me. My code is: ffmpeg -i $input_url -c:v copy -c:a copy -listen 1 -f mpegts http://localhost:port/live/test When I open it in VLC, it starts feeding my screen and I see bitrate values. When I stop watching it,... (4 Replies)
Discussion started by: baris35
4 Replies

2. Shell Programming and Scripting

Saving nohup output to a file other than nohup.out

Shell : bash OS : Oracle Linux 6.4 I want to save the ouput of a nohup command to file other than nohup.out . Below are my 3 attempts. For both Attempt1 and Attempt2 , the redirection logs the output correctly to the output file. But I get the error "ignoring input and redirecting stderr to... (7 Replies)
Discussion started by: kraljic
7 Replies

3. Shell Programming and Scripting

Output when killing a background process

I played a bit around with the Terminal and I observed something. When I start and kill a background process, there is some kind of output. After I invoked the command to start the process the first message " 13063" is directly displayed. However, after killing the process, the second message "+... (3 Replies)
Discussion started by: Chuck Morris
3 Replies

4. UNIX for Dummies Questions & Answers

Seeing output of background process

I'm pretty sure I had the answer to this months ago and have misplaced it. Needless to say I will bookmark it this time. I have a background process that's been running way longer than usual. It doesn't output anything to a file, so I can't 'tail -f' it. Is there a command that will enable me to... (2 Replies)
Discussion started by: dheian
2 Replies

5. Shell Programming and Scripting

Nohup and background jobs

Hi All, Can someone help me in knowing the exact difference between nohup and &. The definition is quite clear but i only want to know if i run my job using & and in between i hung up my terminal. (10 Replies)
Discussion started by: Uinx_addic
10 Replies

6. Shell Programming and Scripting

Send Foreground job to background redirecting output

I have many CPU intensive processes running and sometimes I run them in the foreground so that I can see what the output is. I want to send that foreground process to the background, but also have it direct the output to a logfile. I know to send something to the bg I do Ctrl-z on the FG... (6 Replies)
Discussion started by: jhullbuzz
6 Replies

7. 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

8. 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

9. UNIX for Advanced & Expert Users

send a new value to a variable in a running background process

Hi guys, I have a issue with a background process, I need to update the value of a variable in that process which is running at this time and it will be running for at least 2 days. Any idea? I will apreciate your help. regards. Razziel. (2 Replies)
Discussion started by: razziel
2 Replies

10. UNIX for Advanced & Expert Users

nohup and background process

What is the difference between running a process using nohup and running a process in background ? Please explain (6 Replies)
Discussion started by: srksn
6 Replies
Login or Register to Ask a Question