AIX: Find a process older than 15days


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting AIX: Find a process older than 15days
# 1  
Old 01-30-2012
AIX: Find a process older than 15days

Hi All,

My application has specific processes when the developers start using respective GUI . I would like to find related process on server side that is older than 15 days for my application.
I am using AIX 6.0. Could you please help with the command on how to find the older process?

Thank you.
# 2  
Old 01-30-2012
Use the ps command. It has a column where the time elapsed since start is displayed. You can also specify a custom format with -o to display only those status infos you need. That as a start. More info is in the man pages of this command. The rest can be achived with for example grep and if/then/fi etc...
# 3  
Old 01-30-2012
Thank you for the response. I did read the man page for ps and tried to execute the following command.
ps -o user,pid,etime | grep dsap and this did not result in any output. But I do see the related processes are running. Sample command would be really helpful. Thank you.
# 4  
Old 01-30-2012
Code:
ps -eo user,pid,etime | grep dsap

ps -e looks at ALL processes.
# 5  
Old 01-31-2012
Will it work for you?

Code:
 
MYDP=2 ## Days elapsed
 
ps -eo etime,uid,pid,comm | awk -v x=$MYDP -F'-' '{if($1 > x) print $0}' | awk '{print $4}'

# 6  
Old 01-31-2012
Thank you all for your response. This works for me.

-Chandra
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

Older versions of the XL C/C++ Evaluation for AIX 5.3

Hello, IBM offers a evaluation version of their XL C/C++ compiler. Unfortunatly v16.1 (from Developerworks) can not be installed on AIX 5.3 (I can not upgrade my old 32 Bit RS/6000 to a later version) and I have not found any older versions on the IBM and Developerworks pages. Is there a... (8 Replies)
Discussion started by: eh2scqw
8 Replies

2. Shell Programming and Scripting

Find processes older than 1 day

// AIX 6.1 I need to extract PIDs of ps -ef |grep /usr/lib/lpd/pio | awk '{print $2}' ps -ef |grep qdaemon |grep /usr/bin/ksh | awk '{print $2}' that are older than 1 day. I know find . -type f -mtime +1, but it doesn't work for PIDs. Please let me know how to get the PIDs older than... (1 Reply)
Discussion started by: Daniel Gate
1 Replies

3. Linux

Logrotate every 15days

Hi all, I have been asked to configure logrotate for a perticular log file for every 15 days. I do not find options other than weekly or monthly.Need you expertise on the same:confused: (0 Replies)
Discussion started by: iron_michael86
0 Replies

4. Shell Programming and Scripting

Find files older than 8 hours

I need a script to find files older than 8 hours... I know i can use mmin but the same is not working...the same only support mtime... This is the script i created..but the same is only giving 1 hour old..as I have given dt_H as 1 only...but if i give 8..it can go in -(negative)..how to get the... (5 Replies)
Discussion started by: cotton
5 Replies

5. AIX

How to find what process is using a port in AIX 5L and above.

There have been a lot of threads about how to find processes that are using a specific port on an AIX server. After long hours of research and reading countless "you can't do that" responses, I finally found the answer. YES IT CAN BE DONE! YES ITS EASY. NO, I DON'T KNOW WHY NO ONE GETS THIS... (2 Replies)
Discussion started by: troym72
2 Replies

6. AIX

How do i delete files older than 15 days in AIX?

Hi i have tried searching and googling, but cant quite get there I need to delete all files in a directory that are older than 15 days here is what i have tried find /path/to/files* -mtime +15 -exec del {} \;the first section works find /path/to/files* -mtime +15but the del command dosent... (4 Replies)
Discussion started by: bluesteel
4 Replies

7. AIX

Find CPU per process in AIX

Hi. I am looking for a command that will return me the amount of CPU used by a specific process in AIX environment. I know there is TOPAS - but it is interactive and I need to get this information from system that connects remotely via SSH. Using writing to files and than reading them is also... (1 Reply)
Discussion started by: yamsin789
1 Replies

8. AIX

Cmd to find CPU utiliz of a process in AIX

Hello All, I wanna find the CPU utilization of a specific process running on AIX OS. I have its pid, but not sure about the command. iostat sar 5 5 vmstat All the above give me system CPU utilization. Is there a way to find for a specific pid??? Thanks, Ankita (11 Replies)
Discussion started by: Ankita
11 Replies

9. Shell Programming and Scripting

Find files older than 20 days & not use find

I need to find files that have the ending of .out and that are older than 20 days. However, I cannot use find as I do not want to search in the directories that are underneath the directory that I am searching in. How can this be done?? Find returns files that I do not want. (2 Replies)
Discussion started by: halo98
2 Replies

10. Post Here to Contact Site Administrators and Moderators

How to remove 15days back old files

Hi Experts, I want to delete the log files which is created 15 days back. 1st I want to view the files and later I want to delete viewed files I have tried with following command but its not working. find . -name '*.log' -mtime +15 -exec ls -ltr {} \; This is showing the list which shows... (2 Replies)
Discussion started by: vidya2006
2 Replies
Login or Register to Ask a Question