Solved

Linux : view output of already running processes in linux

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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
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.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

920 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now