Sponsored Content
Top Forums Shell Programming and Scripting Print only processes running for more than 24 hours Post 302850991 by Jotne on Friday 6th of September 2013 07:43:54 AM
Old 09-06-2013
@anil510
Post the output of ps -eo pid,pcpu,pmem,user,args,etime,cmd --sort=start_time
This way we need not guess what you see.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How do you print the number of processes that each user is currently running in Unix?

Ok, so I know there's a way to do this, but I've been trying to find out all afternoon with no luck. I think it should print out something like this: 1 bin 2 daemon 6 duo Where the numbers on the left are the number of processes being run by the user whose name is listed on the right. Is... (4 Replies)
Discussion started by: Duo11
4 Replies

2. UNIX for Dummies Questions & Answers

Capture running process for 2 hours with an interval of 10 sec

Hi, Can any one help me on this. How to capture the running process for two hours with an interval of 10 sec. Thanks in andvance Double post, continued here, thread closed (0 Replies)
Discussion started by: sarathkumar
0 Replies

3. Shell Programming and Scripting

Capture running process or 2 hours with an interval of 10 sec

Hi, Can any one help me on this. How to capture the running process for two hours with an interval of 10 sec. Thanks in andvance (1 Reply)
Discussion started by: sarathkumar
1 Replies

4. Shell Programming and Scripting

Capture the running process for 2 hours

Hi, How can i capture the running process for 2 hours. Thanks in advance.:b: (1 Reply)
Discussion started by: sarathkumar
1 Replies

5. Shell Programming and Scripting

List of Running Jobs In Last 4 Hours

Hi Experts, Please help me in this. I am trying this code on AIX 5.3. I need list of jobs that executed in last 4 hours. I have a schedule on this script - cron executes it and sends mail to me for every 2 hours. I have a Job time and have around 100 jobs those execute daily. What all i need... (2 Replies)
Discussion started by: rajubollas
2 Replies

6. UNIX for Dummies Questions & Answers

find the no of processes that ran 2 hours before or earlier

Is there a way to find out the total no of processes that were running ? - 2 or 3 hours before - list those no of processes (3 Replies)
Discussion started by: jansat
3 Replies

7. UNIX for Dummies Questions & Answers

At command not running out of hours

Hi All, new to the forum and new to Unix but I have an issue which is annoying on a new level. I have included a short and full version for anyone needing more information. Short Version I am running a set of scripts that work and run fine. one of the scripts arranges the first... (4 Replies)
Discussion started by: Delboy4000
4 Replies

8. Shell Programming and Scripting

Can anyone help me to print UNIX epoch time to days,hours,min,sec ?

I have unix epoch time 1441678454803, Can you please help me to print this time in below format ? DAY,HOUR,MIN,SEC Appreciate your help!!! Thanks, Prince (7 Replies)
Discussion started by: prince1987
7 Replies

9. UNIX for Beginners Questions & Answers

How to display processes which have been running for more than a X hours?

Hi, Is it possible to display processes which have been running for more than a 5hrs using a variation of the ps -ef command? Regards, Manny (5 Replies)
Discussion started by: mantas44
5 Replies

10. UNIX for Beginners Questions & Answers

How to check the processes running longer than 2 hours.?

HI can someone help me to check the process running more than 2 hours. I have the below command which shows the time and process id, however, I only need the processes running more than 2 hours. (8 Replies)
Discussion started by: Vinod
8 Replies
IPC::Open2(3perl)					 Perl Programmers Reference Guide					 IPC::Open2(3perl)

NAME
IPC::Open2 - open a process for both reading and writing using open2() SYNOPSIS
use IPC::Open2; $pid = open2(*CHLD_OUT, *CHLD_IN, 'some cmd and args'); # or without using the shell $pid = open2(*CHLD_OUT, *CHLD_IN, 'some', 'cmd', 'and', 'args'); # or with handle autovivification my($chld_out, $chld_in); $pid = open2($chld_out, $chld_in, 'some cmd and args'); # or without using the shell $pid = open2($chld_out, $chld_in, 'some', 'cmd', 'and', 'args'); waitpid( $pid, 0 ); my $child_exit_status = $? >> 8; DESCRIPTION
The open2() function runs the given $cmd and connects $chld_out for reading and $chld_in for writing. It's what you think should work when you try $pid = open(HANDLE, "|cmd args|"); The write filehandle will have autoflush turned on. If $chld_out is a string (that is, a bareword filehandle rather than a glob or a reference) and it begins with ">&", then the child will send output directly to that file handle. If $chld_in is a string that begins with "<&", then $chld_in will be closed in the parent, and the child will read from it directly. In both cases, there will be a dup(2) instead of a pipe(2) made. If either reader or writer is the null string, this will be replaced by an autogenerated filehandle. If so, you must pass a valid lvalue in the parameter slot so it can be overwritten in the caller, or an exception will be raised. open2() returns the process ID of the child process. It doesn't return on failure: it just raises an exception matching "/^open2:/". However, "exec" failures in the child are not detected. You'll have to trap SIGPIPE yourself. open2() does not wait for and reap the child process after it exits. Except for short programs where it's acceptable to let the operating system take care of this, you need to do this yourself. This is normally as simple as calling "waitpid $pid, 0" when you're done with the process. Failing to do this can result in an accumulation of defunct or "zombie" processes. See "waitpid" in perlfunc for more information. This whole affair is quite dangerous, as you may block forever. It assumes it's going to talk to something like bc, both writing to it and reading from it. This is presumably safe because you "know" that commands like bc will read a line at a time and output a line at a time. Programs like sort that read their entire input stream first, however, are quite apt to cause deadlock. The big problem with this approach is that if you don't have control over source code being run in the child process, you can't control what it does with pipe buffering. Thus you can't just open a pipe to "cat -v" and continually read and write a line from it. The IO::Pty and Expect modules from CPAN can help with this, as they provide a real tty (well, a pseudo-tty, actually), which gets you back to line buffering in the invoked command again. WARNING
The order of arguments differs from that of open3(). SEE ALSO
See IPC::Open3 for an alternative that handles STDERR as well. This function is really just a wrapper around open3(). perl v5.14.2 2011-09-26 IPC::Open2(3perl)
All times are GMT -4. The time now is 06:59 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy