Sponsored Content
Top Forums Shell Programming and Scripting Capture running process or 2 hours with an interval of 10 sec Post 302509724 by rmtzcx on Thursday 31st of March 2011 02:41:27 PM
Old 03-31-2011
Use top

Assuming you want the output on stdin (something similar to vmstat or iostat):

Code:
top -d 10 -n 720 -b

If you are interested in any particular process, use the -p option, for example to see the init process every 10 seconds for 1 hour:

Code:
top -d 10 -n 360 -b -p 1

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

capture the process id when starting a background process

Hello all, How do I start a background process and save the process id to a file on my system. For example %wait 5 & will execute and print the process id. I can't figure out how to get it to a file. I've tried: > filename 0>filename 1>filename. Any assistance is most appreciated. Thanks, Jim... (10 Replies)
Discussion started by: jleavitt
10 Replies

2. UNIX for Advanced & Expert Users

my process is going to sleep mode after 12 hours but i need my process in in firsy pr

hi all I process is sleeping after 12 hours but i need to be run this to 24 hours but it goes in sleep mode after 12 hours what should i do to make process always running.Kindly give me suggestion. (0 Replies)
Discussion started by: mukesh_rakesh1
0 Replies

3. Shell Programming and Scripting

Add data in days:hours:min:sec format

I want to add these no. these are in the format of days:hours:minutes:sec I want result in this format only 0:00:04:59 0:00:00:12 0:00:00:28 0:00:00:03 0:01:29:35 0:00:00:19 0:01:05:21 Is any body ca help me????? To get This.. Thanks Nishant (1 Reply)
Discussion started by: krishna_sicsr
1 Replies

4. Solaris

how to capture oracle export log while running as background process

I ran the Oracle 9i export command from a terminal to export out a big table using "exp andrew/password file=andrew.dmp log=andrew.log" From the terminal I can see that the export is running as there is some output from the oracle export job. The export job is not complete yet. When i go check... (4 Replies)
Discussion started by: hippo2020
4 Replies

5. 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

6. 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

7. Shell Programming and Scripting

Print only processes running for more than 24 hours

How can I print ONLY processes running for more than 24 hours. Using ps command or any other method I use this to get a whole list. ps -eo pid,pcpu,pmem,user,args,etime,cmd --sort=start_time We can also sort the outout of the above command to list processes older than 24 hours using... (9 Replies)
Discussion started by: anil510
9 Replies

8. 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

9. 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

10. 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
DTK_NANOSLEEP(3)						Draw Toolkit manual						  DTK_NANOSLEEP(3)

NAME
dtk_nanosleep - high-resolution sleep SYNOPSIS
#include <dtk_time.h> int dtk_nanosleep(int abs, const struct dtk_timespec* req, struct dtk_timespec* rem); DESCRIPTION
The function dtk_nanosleep() allows the caller to sleep for an interval with nanosecond precision. If the argument abs is zero, the speci- fied interval is interpretated as a relative value, otherwise an absolute value. The interval is specified by the req argument which is a pointer to a dtk_timespec structure defined as: struct dtk_timespec { long sec; /* seconds */ long nsec; /* nanoseconds */ }; If interpreted as an absolute value, it represents seconds and nanoseconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC). dtk_nanosleep() suspends the execution of the calling thread until either at least the time specified by req has elapsed, or a signal is delivered that causes a signal handler to be called or that terminates the process. If the call is interrupted by a signal handler, dtk_nanosleep() returns -1, and sets errno to EINTR. In addition, if rem is not NULL, and abs is zero, it returns the remaining unslept time in rem. This value can then be used to call dtk_nanosleep() again and complete a (rela- tive) sleep. RETURN VALUE
On successfully sleeping for the requested interval, dtk_nanosleep() returns 0. If the call is interrupted by a signal handler or encoun- ters an error, then it returns -1 and errno is set appropriately. ERRORS
dtk_nanosleep() will fail if: EINTR The sleep was interrupted by a signal handler. EINVAL The value in the nsec field was not in the range 0 to 999999999 or sec was negative. NOTE
This function is a wrapper to clock_nanosleep(2) if it is provided by the system. Otherwise, it implements the function by using the sleep function with the highest precision available on the system. SEE ALSO
dtk_nanosleep(3), clock_nanosleep(2) EPFL
2011 DTK_NANOSLEEP(3)
All times are GMT -4. The time now is 09:11 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy