[HPADM] RE: RE: find command missing -mmin flag




Admins --

Thank you all.

What we needed to do was kill all processes running X that have been
running over 30 minutes. the find -mmin was perfect, because I could
have done a

touch $KILL_DIR/`ps -ef|grep X|grep -v grep|awk '{print $2}'`

every Y minutes, then I could have done a

find $KILL_DIR -name "*.kill_this_proc" -mmin -30 -exec kill -9

Unfortunately, because -mmin is not standard to HP-UX, we have to use
-newer, as so many of you rightly pointed out. Of course, we really
need an "older" function, rather than a "newer" function, but that's all
semantics.

So, armed with the perl scripts a few of you were kind enough to send, I
was able to construct the touchfile without having to do all the weird
date-math functions in my code. With the reference file in place, all
that was left was to do an ls > somefile, then use grep -v to remove
everything from the file newer than the reference file, then go through
and kill the processes. This is far from the two line command that
would have been in place had HP-UX included the -mmin function, but,
it's workable.

I appreciate everyone's input.

Best wishes,
Bambi.

________________________________

From: hpux-admin-owner@xxxxxxxxxxxxx
[mailto:hpux-admin-owner@xxxxxxxxxxxxx] On Behalf Of Bellows, Bambi
Sent: Monday, April 23, 2007 11:52 AM
To: hpux-admin@xxxxxxxxxxxxx
Subject: [HPADM] RE: find command missing -mmin flag


Hi Admins All!

Thank you all for your quick emails back. I wanted to send this
clarification along, because it might save some aggravation... I should
have sent this first, but, um, well, er...

===============
I was going to use newer, but it's not the easiest was to do it because
then you have to construct a calendar so that at 00:20, the touch file
is created yesterday at 23:50, and then, of course you have to deal with
the first of the month/year issues. From what I see, the *easiest* way
to do it is to download the GNU utilities that give me the -mmin flag
on find. The next easiest thing, I think, is to use Oracle to do the
date-math, but that, of course, requires that Oracle be up and that I
have access to the database with a non-privileged account. Then the
next easiest, from what I see, is to do -newer. But, I was hoping
someone had some kind of uber knowledge that they could say "oh, there's
a date-math function that you can use to trick find into being more
useful". I suspect those people are out there. I also suspect those
people are developers for GNU who will point me to the website. Problem
is that I'm not cleared to download stuff... :(
===============

Thanks again!
Bambi.

________________________________

From: hpux-admin-owner@xxxxxxxxxxxxx
[mailto:hpux-admin-owner@xxxxxxxxxxxxx] On Behalf Of Bellows, Bambi
Sent: Monday, April 23, 2007 11:15 AM
To: hpux-admin@xxxxxxxxxxxxx
Subject: [HPADM] find command missing -mmin flag


Hi Admins!

I am looking for files created 30 minutes ago. In other Unixes, I can
use "find -mmin 30" but that flag doesn't seem to be available. Without
that flag, I do I go about doing this? It doesn't *seem* like it should
be rocket science... and yet... :)

Thanks!
Bambi.
Confidentiality Notice: This email is intended for the sole use of the
intended recipient(s) and may contain confidential, proprietary or
privileged information. If you are not the intended recipient, you are
notified that any use, review, dissemination, copying or action taken
based on this message or its attachments, if any, is prohibited. If you
are not the intended recipient, please contact the sender by reply email
and destroy or delete all copies of the original message and any
attachments. Thank you.

Confidentiality Notice: This email is intended for the sole use of the
intended recipient(s) and may contain confidential, proprietary or
privileged information. If you are not the intended recipient, you are
notified that any use, review, dissemination, copying or action taken
based on this message or its attachments, if any, is prohibited. If you
are not the intended recipient, please contact the sender by reply email
and destroy or delete all copies of the original message and any
attachments. Thank you.



Confidentiality Notice: This email is intended for the sole use of the intended recipient(s) and may contain confidential, proprietary or privileged information. If you are not the intended recipient, you are notified that any use, review, dissemination, copying or action taken based on this message or its attachments, if any, is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy or delete all copies of the original message and any attachments. Thank you.

Relevant Pages

  • Re: VS: Unzipping problem | write error (disk full?)
    ... the man pages and use the -t flag while extracting as well. ... This message, including all attachments, is intended for the use ... distribution or copying of this communication is strictly prohibited. ... to its intended recipient, you are hereby notified that any dissemination, ...
    (RedHat)
  • [HPADM] RE: find command missing -mmin flag
    ... find command missing -mmin flag ... based on this message or its attachments, if any, is prohibited. ... are not the intended recipient, please contact the sender by reply email ... and destroy or delete all copies of the original message and any ...
    (HP-UX-Admin)
  • Re: System crash
    ... if gdm, gid 42 exists. ... This message, including all attachments, is intended for the ... to its intended recipient, you are hereby notified that any ... distribution or copying of this communication is strictly prohibited. ...
    (RedHat)
  • Re: Commercial router
    ... there was a setting that blocked access ... This message, including all attachments, is intended for the ... have received this communication in error, ... to its intended recipient, you are hereby notified that any dissemination, ...
    (RedHat)
  • Re: Strange Problems/Any way to completely clear out an eTrex Vista?
    ... This email and any attachments may contain confidential material for the ... If you are not the intended recipient, ... Tech support request for eTrex Vista ...
    (sci.geo.satellite-nav)