LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-12-2008, 03:42 AM   #1
sachin1112
LQ Newbie
 
Registered: Sep 2008
Posts: 1

Rep: Reputation: 0
How to get Process start time ???


Hi All,

I have a started a process say X. I can see its starting time through ps -ef | grep X
at the same time a directory is created in /proc with the process ID of X. after some days i gain check my process. it will show only the date and not the time. now my question is is there any log file maintined by the kernal where i can get the start time of the process.
There must be a log file in the system but i am not able to find the exact location. i have searched in /proc/{pid}/stat, but i am not able to get it.
Can u help me in finding the exact location where the log file is created.

cheers!!
Sachin
 
Old 09-13-2008, 12:28 PM   #2
nadroj
Senior Member
 
Registered: Jan 2005
Location: Canada
Distribution: ubuntu
Posts: 2,539

Rep: Reputation: 60
if you know the process id and you know that a folder is created when the process starts in /proc/{pid}/ then why not simply check the creation time of the folder using 'properties' in gui or 'ls -dl /proc/{pid}' in command line?

edit: after a quick read of 'man ps', you can get this information in a number of ways, ie: "ps -p {pid} -o lstart" will print the date and time the process started. see the man page for other ways (ie replace 'lstart' with 'bsdstart' or 'etime' to get different formats). there is also a switch to remove the output header, so that if your using this in a script you dont need to do any parsing.

Last edited by nadroj; 09-13-2008 at 01:09 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Process start time check ratul_11 Linux - General 1 02-21-2008 06:49 PM
How to start bash commands automatically every time I start the computer brgsousa Linux - Software 2 10-18-2007 12:26 PM
GDM takes a *long* time to start first time grumpybuffalo Linux From Scratch 2 09-09-2007 01:17 PM
Incorrect process start time hulala Fedora 2 04-26-2005 10:36 PM
start date and start time of a process - jiffies Yoko Programming 0 12-04-2004 09:12 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:10 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration