Solved

Linux : view output of already running processes in linux

Posted on 2014-01-28
4
966 Views
Last Modified: 2014-01-28
I am running a SOME shell scripts in the background that prints some progress information to the stdout ie terminal. ($ nohup perl script001.pl &)

As all these scripts takes few days to get completed  I will have to logout. This loses the output to the terminal. Is there anyway to regain the progress output for any specific process when i log back in?

I know i could pipe the output to a file, but I don't really want to do that.

Any ideas on this would be greatly appreciated

I hope you clearly  understood question, prior you give me the answer
0
Comment
Question by:mac_g
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 8

Accepted Solution

by:
Surrano earned 400 total points
ID: 39814614
1. Use nohup. It will make sure the process keeps running even after the user session has ended.

2. Use screen and enable screen logging.

3. If you have already started then spy on file descriptors, e.g. for PID=1234:
tail -f /proc/1234/fd/1

Open in new window

0
 

Author Comment

by:mac_g
ID: 39814652
it is pefect ...

working good  ...

what is fd,1 ... in the above command ??
0
 
LVL 8

Expert Comment

by:Surrano
ID: 39814709
fd is "file descriptors" and 1 is the standard output.
0 is standard input, 2 is standard error. The rest are arbitrary file descriptors opened by the process.
0
 

Author Comment

by:mac_g
ID: 39814716
thanks for your help ...
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Fine Tune your automatic Updates for Ubuntu / Debian
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question