02-08-2011
Q's on Active Process Time
Is it possible to display active processes' Year,Month,Day,Hour,Minute,Second info of process start time ? Preferbly in the format "YYYY/MM/DD HH:MM:SS" ?
I tried to do this with the ps command but it only gets the time or date.
Any help will be greatly appreciated.
Cheers
Steve
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
hi
i'm running a shell script that checks the amount of cpu idle either using /usr/bin/vmstat 1 2 or sar 1 2 (on unixware) before i run some tests(if cpu idle greater than 89 I run them).
These tests are run on many platforms, linux(suse, redhat) hp-ux, unixware, aix, solaris, tru64.
... (5 Replies)
Discussion started by: OFFSIHR
5 Replies
2. UNIX for Dummies Questions & Answers
how to decrease priority of a particular process in time of process creation...
and also how to decrease priority of a particular process after process creation..
can any one please help me out... (2 Replies)
Discussion started by: Ramkum
2 Replies
3. UNIX for Advanced & Expert Users
Hi All,
I am running the following accounting on one of my executable,
$ accton /home/myexe-acct
$ ./myexe
$ accton
When I check the process timings I get the below result,
Shell process time: 300ms
myexe time: 100ms
I want to know on why the shell(sh) process is taking so much time... (1 Reply)
Discussion started by: santoshbr4
1 Replies
4. Linux
Process start time is not showing the correct time:
I had started a process on Jun 17th at 23:30:00.
Next day morning when I run the command "ps -ef | grep mq", the process is showing the start date of Jun 17th but the start time is 00:16:41
Day/Date is setup correctly on the server.
It... (2 Replies)
Discussion started by: hemangjani
2 Replies
5. UNIX for Advanced & Expert Users
I have some Solaris processes that run weeks at a time that create rather large log files that I would like to archive/compress daily. Instead of stopping the process, what can be done so that the log file is backed up and shrunk, but the process can still log to the open file handle without major... (7 Replies)
Discussion started by: ckmehta
7 Replies
6. Shell Programming and Scripting
Hi ,
Please help me
shell script to determine the active processes on the system which are running since long time (2 Replies)
Discussion started by: itian2010
2 Replies
7. Shell Programming and Scripting
Hello All,
I have a problem calculating the time difference between start and end timings...!
the timings are given by 24hr format..
Start Date : 08/05/10 12:55
End Date : 08/09/10 06:50
above values are in mm/dd/yy hh:mm format.
Now the thing is, 7th(08/07/10) and... (16 Replies)
Discussion started by: smarty86
16 Replies
8. UNIX for Dummies Questions & Answers
What kind of problems can be faced if any session which connects to unix server is open for longer time?
How to find out from how much time that session is idle? :) (2 Replies)
Discussion started by: anandgodse
2 Replies
9. UNIX for Dummies Questions & Answers
We have written a bare bones scheduling app using bash scripts. The input to the scheduler is from a mainframe scheduling tool, and the scripts exit code is returned to the MF. The problem is that every now and again I have a script that does not complete and this is left in my Q. I am in the... (1 Reply)
Discussion started by: Charles Swart
1 Replies
LEARN ABOUT NETBSD
clock_ymdhms_to_secs
TODR(9) BSD Kernel Developer's Manual TODR(9)
NAME
todr_attach, todr_gettime, todr_settime, clock_ymdhms_to_secs, clock_secs_to_ymdhms -- time-of-day clock support
SYNOPSIS
#include <dev/clock_subr.h>
void
todr_attach(todr_chip_handle_t);
int
todr_gettime(todr_chip_handle_t, struct timeval *);
int
todr_settime(todr_chip_handle_t, struct timeval *);
void
clock_secs_to_ymdhms(int, struct clock_ymdhms *);
time_t
clock_ymdhms_to_secs(struct clock_ymdhms *);
DESCRIPTION
The todr_*() functions provide an interface to read, set and control 'time-of-day' devices. A driver for a 'time-of-day' device registers
its todr_chip_handle_t with machine-dependent code using the todr_attach() function. Alternatively, a machine-dependent front-end to a
'time-of-day' device driver may obtain the todr_chip_handle_t directly.
The todr_gettime() retrieves the current data and time from the TODR device and returns it in the struct timeval storage provided by the
caller. todr_settime() sets the date and time in the TODR device represented by todr_chip_handle_t according to the struct timeval argument.
The utilities clock_secs_to_ymdhms() and clock_ymdhms_to_secs() are provided to convert a time value in seconds to and from a structure rep-
resenting the date and time as a <year,month,day,weekday,hour,minute,seconds> tuple. This structure is defined as follows:
struct clock_ymdhms {
u_short dt_year; /* Year */
u_char dt_mon; /* Month (1-12) */
u_char dt_day; /* Day (1-31) */
u_char dt_wday; /* Day of week (0-6) */
u_char dt_hour; /* Hour (0-23) */
u_char dt_min; /* Minute (0-59) */
u_char dt_sec; /* Second (0-59) */
};
Note: leap years are recognised by these conversion routines.
RETURN VALUES
The todr_*() functions return 0 if the requested operation was successful; otherwise an error code from <sys/errno.h> shall be returned.
However, behaviour is undefined if an invalid todr_chip_handle_t is passed to any of these functions.
The clock_ymdhms_to_secs() function returns -1 if the time in seconds would be less that zero or too large to fit in a time_t. The
clock_secs_to_ymdhms() function never fails.
SEE ALSO
intersil7170(4), mk48txx(4), inittodr(9), resettodr(9), time_second(9)
BSD
September 6, 2006 BSD