I don't why I can't run the command now ,maybe my shell changed...It doesn't matter..
So the command is not very good . we use a script.
First we find out the pid of process that has running in the system for more than 3 days.
Second we can find which process with pid.
FYI:
[root@unix proc]# ps -p 4062 -o stat,euid,ruid,tty,tpgid,sess,pgrp,ppid,pid,pcpu,comm
STAT EUID RUID TT TPGID SESS PGRP PPID PID %CPU COMMAND
Ss+ 0 0 tty2 4062 4062 4062 1 4062 0.0 mingetty
---------- Post updated at 09:11 AM ---------- Previous update was at 09:07 AM ----------
Quote:
Originally Posted by fpmurphy
As far as I recall, HP-UX does not have a /proc filesystem.
Oh no, so we can't use /proc ...
---------- Post updated at 09:28 AM ---------- Previous update was at 09:11 AM ----------
so can we use this option of ps below ?
bsdstart START time the command started. If the process was started less
than 24 hours ago, the output format is " HH:MM", else it
is "mmm dd" (where mmm is the three letters of the month).
An earlier poster asked for ideas which would work with standard HP-UX commands.
We can get the elapsed time accurately from the alternative format of "ps".
For example:
However the "ELAPSED" column is fiddly to process because it is in three possible formats according to how long the elapsed time is.
<space><space><space>MM:SS
HH:MM:SS
D-HH:MM:SS
(Where D=days with no leading zeros)
The hyphen between days and hours is going to be handy because we can immediately eliminate processes which are less than a day old. Depending on the accuracy required for "3 days old" we could just use the days field or use it with the HH:MM:SS fields to create an elapsed time in any units.
Hello all,
I want to list the files older than 10 days. Currently am using
find ./ -mtime +10 -exec ls -ltr {} \;
command. But I want to execute the same command in 16 directories at a time and want an output asking to remove those file?
Please help me to design the script.
regards,
Ajay (3 Replies)
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)
In AIX I am trying to get the processes ran by user declan using the following format:
ps -aef -o user,pid,etime,args | grep declan
Then I get a result similar to (for example):
declan 103264 123-12:47:33 /applications/apache/1.3.39.0/bin/httpd -d /var/applications/apache/www1
... (0 Replies)
Hi Frnds,
I have to list the files which are older than 7 days in the given directory.
it should consider only the files and should not show subdirectories.
Thanks,
Raja (3 Replies)
Hi,
I want to find the list of all the files under a directory (including it's subdirectories) last modified 30 days, 60 days, 90 days..also I want to find out the rate at which the disk space is growing.
Please help. (3 Replies)
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)
Say folder archive/ contains many folder each created on a day. this folder may contain files. i want to write a script to delete all the folder inside archive/ which are 7 days older. i used the below script for the reason.
find archive -mtime +7 -type d -exec rm -r {} \;
pls suggest me if... (3 Replies)