LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 02-01-2008, 07:03 AM   #1
ajeetraina
Member
 
Registered: Jun 2007
Location: India
Distribution: Ubuntu,Red Hat, Fedora
Posts: 292

Rep: Reputation: 30
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
 
Old 02-01-2008, 07:28 AM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian Squeeze
Posts: 5,772

Rep: Reputation: 309Reputation: 309Reputation: 309Reputation: 309
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.

Last edited by bigrigdriver; 02-01-2008 at 07:30 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to find the process ID of process executing in the background akeneche Linux - Newbie 1 01-03-2008 10:08 AM
Regarding Background process. mahabooba Linux - Distributions 3 12-26-2006 04:05 PM
really background a process Henster Linux - Newbie 1 07-01-2005 05:29 AM
how to run any binary in background - background process tej Linux - Newbie 1 08-16-2004 12:27 AM
background process gurra Programming 9 09-30-2001 01:31 PM


All times are GMT -5. The time now is 01:31 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration