Solved

Linux : view output of already running processes in linux

Posted on 2014-01-28
4
952 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
  • 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
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.

791 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