background output


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users background output
# 1  
Old 08-08-2006
background output

Question:
I run a script to check a filesystem or two and put it in the background vi a ssh session. Now, upon killing the window(ssh session) the script will of course keep running, BUT if I log back into the box via ssh how can I get the output of the script back to my ssh session/window?

Is this at all possible?

TIA,
BA
# 2  
Old 08-08-2006
If you executed the process this way:
Code:
nohup myproc  &

without redirection, then nohup.out in the current directory has the output.
# 3  
Old 08-08-2006
In your example, 'nohup' is supposed to be the name of the output file?...and 'myproc' is the script? This does not work so I must be missing something....the shell looks for nohup as a command.

-BA
# 4  
Old 08-08-2006
Quote:
Originally Posted by smtpgeek
In your example, 'nohup' is supposed to be the name of the output file?...and 'myproc' is the script? This does not work so I must be missing something....the shell looks for nohup as a command.

-BA
no, 'nohup' is a command [man nohup].
the output of 'nohup myproc &' is file 'nohup.out'
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

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? nohup myprocess.ksh > myprocess.out & Thanks in advance guys !!! :) (3 Replies)
Discussion started by: vx04
3 Replies

2. Shell Programming and Scripting

Capture output of command triggered in background

Is there any way to trigger a sequence of commands in parallel and capture their output in variables? e.g. something on the following lines x=`echo "X" &` y=`echo "Y" &` z=`echo "Z" &` so that $x, $y, and $z evaluate to X, Y and Z res. (7 Replies)
Discussion started by: jawsnnn
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

Capturing the output of a background job

Hello, I unfortunately have a process that does two things, it returns an answer to me and then does a bunch of work that I would like to wait on. Here is a simple example: #!/bin/bash function p_w { echo "poopy" sleep 10 echo "scoop" } foo=$(p_w &) sleep 1 echo "1... (7 Replies)
Discussion started by: brsett
7 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

background functions doesn't display their output

hello there, there's a function, in my shell script, i'd like to run in the background. here's an example: log() { local SELF=${0##*/} tty -s && echo ": $*" } some_func() { # do something log "This text is not displayed in the terminal's output when running in the... (1 Reply)
Discussion started by: Shedon
1 Replies

8. Shell Programming and Scripting

piping output of tail running in background

Not sure why this does not work in bash: tail -f err.log |& -bash: syntax error near unexpected token `&' I am attempting to continuously read a file that is being updated by doing a "tail -f" on the file and piping the output to stdin which can then be read by the next shell command Thnx (4 Replies)
Discussion started by: anuramdas
4 Replies

9. UNIX for Dummies Questions & Answers

How to store output in variable when put in background

Hi, How do I store following command output: export RESULT=`date` & It works when I do : export RESULT=`date` But what I need is when command put it background, I also need that output going to RESULT variable. Is there any way ? Thanks Sanjay (1 Reply)
Discussion started by: sanjay92
1 Replies

10. UNIX for Advanced & Expert Users

backups in background

Hi, how i can do background backup process in Unix?? I has Solaris Operating System. very much thanks!! (4 Replies)
Discussion started by: jairog
4 Replies
Login or Register to Ask a Question