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

From: Bellows, Bambi (bbellows@usg.com)
Date: Mon Apr 23 2007 - 17:13:12 EDT


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@DutchWorks.nl
[mailto:hpux-admin-owner@DutchWorks.nl] On Behalf Of Bellows, Bambi
Sent: Monday, April 23, 2007 11:52 AM
To: hpux-admin@dutchworks.nl
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@DutchWorks.nl
[mailto:hpux-admin-owner@DutchWorks.nl] On Behalf Of Bellows, Bambi
Sent: Monday, April 23, 2007 11:15 AM
To: hpux-admin@dutchworks.nl
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.

--
             ---> Please post QUESTIONS and SUMMARIES only!! <---
        To subscribe/unsubscribe to this list, contact majordomo@dutchworks.nl
       Name: hpux-admin@dutchworks.nl     Owner: owner-hpux-admin@dutchworks.nl
 
 Archives:  ftp.dutchworks.nl:/pub/digests/hpux-admin       (FTP, browse only)
            http://www.dutchworks.nl/htbin/hpsysadmin   (Web, browse & search)


This archive was generated by hypermail 2.1.7 : Sat Apr 12 2008 - 11:02:56 EDT