Find processes older than 1 day

Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Find processes older than 1 day
# 1  
Old 10-09-2013
Find processes older than 1 day

// AIX 6.1

I need to extract PIDs of
PHP Code:
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
HTML Code:
find . -type f -mtime +1
, but it doesn't work for PIDs.

Please let me know how to get the PIDs older than 1 day.
# 2  
Old 10-10-2013
ps -o etime,pid,user,args -e|awk '/^[0-9]+-/'

If you want it sorted:
ps -o etime,pid,user,args -e|awk '/^[0-9]+-/'|sort -t- -n -k 1,1

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Grep files older than 1 day

I thought that this would work for grep'ing files older than 1 day. ps -o etime,pid,user,args -e|awk '/^+-/'|sort -t- -n -k 1,1 |grep qdaemon |grep /usr/bin/ksh But, it is not grep'ing any of files (i.e. below) older than 1 day. d_prod 33757970 61999560 0 Oct 27 - 0:00... (8 Replies)
Discussion started by: Daniel Gate
8 Replies

2. Shell Programming and Scripting

Sftp - 1 day older files count

Need to write a shell script on AIX box which will connect to different servers using SFTP and get the file count of only 1 day older files. (purging list) How to achieve this? On local server we can use: find <path> -type f -mtime +1 But how to do it in case of SFTP? Please advise. Thanks... (9 Replies)
Discussion started by: vegasluxor
9 Replies

3. Shell Programming and Scripting

How archive the older than 30 day files to another unix server

I need to archive the older than 30 day file to another uinx server.I have wrote the below uinx script. for LOOK_DIR in /TempFiles do for FILE in `find ${LOOK_DIR} -mtime -30 -exec ls {} \;` do echo ${FILE} >> file_list ## This file will have the list of files copied and... (12 Replies)
Discussion started by: murari83.ds
12 Replies

4. HP-UX

listing processes older than n days

Hello; trying to find processes older than n days, mostly user shells Tried the following code on 11.31 box: in this case older than 5 days UNIX95= ps -ef -o user,pid,ppid,cpu,etime,stime | grep "-" | awk '{print $2}' | xargs ps -ef|grep -v '?' |\ awk '$5 !~ ""' | awk '($5 ~ "$(date "+%b")")... (6 Replies)
Discussion started by: delphys
6 Replies

5. Shell Programming and Scripting

Find the number of files older than 1 day from a dir

Hello All, I need to write a script/command which can find out the number of .csv files residing in a directory older than 1 day. The output should come with datewise (means for each date how many files are there). I've this command, but this command gives the total number of files. It's... (10 Replies)
Discussion started by: NARESH1302
10 Replies

6. Shell Programming and Scripting

Listing processes that are a day older

Hi All, I am trying to automate some stuff to make my 'to-do-things' easier. I am in need for help regarding this. I have an output root 17187 3465 0 23:00:00 ? 0:01 Process1 root 4975 4974 0 May 12 ? 0:00 Process2 root 4042 16713 0 Jan 30 pts/22 0:00... (4 Replies)
Discussion started by: reddybs
4 Replies

7. Shell Programming and Scripting

Script to find previous month last day minus one day timestamp

Hi All, I need to find the previous month last day minus one day, using shell script. Can you guys help me to do this. My Requirment is as below: Input for me will be 2000909(YYYYMM) I need the previous months last day minus 1 day timestamp. That is i need 2000908 months last day minus ... (3 Replies)
Discussion started by: girish.raos
3 Replies

8. Shell Programming and Scripting

Need to kill processes that are older than 3 days

Hi, I need a .ksh script that lists all the process that are currently running and older than 3 days. once the process list is available i need to mail the list and then kill those processes. Quick response is highly appreciated :b: Thanks in Advance!!! Sri (3 Replies)
Discussion started by: Sriranga
3 Replies

9. Shell Programming and Scripting

Deleting / finding files older than X days missess a day

Hi When trying to find and delete files which are, say, 1 day, the find command misses a day. Please refer the following example. xxxd$ find . -type f -ctime +1 -exec ls -ltr {} \; total 64 -rw-rw-r-- 1 oracle xxxd 81 Apr 30 11:25 ./ful_cfg_tmp_20080429_7.dat -rw-rw-r-- 1... (4 Replies)
Discussion started by: guruparan18
4 Replies

10. Shell Programming and Scripting

Write a shell script to find whether the first day of the month is a working day

Hi , I am relatively new to unix... Can u pls help me out to find out if the first day of the month is a working day ie from (Monday to Friday)...using Date and If clause in Korn shell.. This is very urgent. Thanks for ur help... (7 Replies)
Discussion started by: phani
7 Replies
Login or Register to Ask a Question