LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Tracking Background PRocess (http://www.linuxquestions.org/questions/linux-newbie-8/tracking-background-process-617915/)

ajeetraina 02-01-2008 07:03 AM

Tracking Background PRocess
 
I have a script running for the last 3 days continously.It is running on the Background.
#fg %1 is a command which tend to bring it in fore-ground.
Now I want to write the output to a file without stopping the process.
All I know is Process ID but finding difficulty in printing it in file.

Pls Help

bigrigdriver 02-01-2008 07:28 AM

If the process in question produces output to stdout (shows on screen while running in foreground), then use the tee command to also write to a file.

fg %1 | tee filename

That will allow on-screen output as well as write to the filename.


All times are GMT -5. The time now is 07:43 PM.