Re: How to find files more than 3 minutes old?
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix questions > Re: How to find files more than 3 minutes old?




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Re: How to find files more than 3 minutes old?  
Dan Mercer


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
12-23-04 10:59 PM


"Alan Connor" <zzzzzz@xxx.yyy> wrote in message news:YPGyd.7696$9j5.6467@new
sread3.news.pas.earthlink.net...
: On Thu, 23 Dec 2004 13:00:19 -0800, sfrady <sfrady@mail.sdsu.edu>
: wrote:
:
: > I have a requirement to find files in a busy directory on our
: > Unix server and delete them if +3 minutes old.  I currently
: > have scripts which delete files more than so many days old, but
: > don't know the ksh syntax for getting the test down to minutes.
: >
: > If anyone knows how to do this, I'd really appreciate some
: > advice!  Thank you, Susan Frady San Diego State University
: >
:
: Your subject and question contain direct quotes from the find
: man page.
:
: Maybe you should read it.
:
: man find
:
: But, of course, you already have, haven't you, Matt?

Hey,  snotty.  Only GNU find has switches for minutes.  If he is using
a SysV find,  it's no help.

I won't do the work for him but:

use date to get current date in MM DD YY hh mm format.
compute 3 minutes ago
use touch to create a file 3 minutes old
then:

for file in *
do
if [[ $file -ot $touchfile ]]
then
..

Or,  if you simply run the file every 3 minutes:

if [[ -f $touchfile ]]
then
for file in *
do
if [[ $file -ot $touchfile ]]
then
..
fi
done
fi

touch $touchfile

Dan Mercer

:
: There's no way that anyone as ignorant as you are pretending to
: be would be allowed anywhere near a "busy unix server", so I
: don't know who you think you are fooling.
:
: This is your third newbie question in the last hour or so, Matt,
: using various aliases, one of them including your real name.
:
: Maybe if you would quit behaving like a retarded juvenile
: delinquent and spend this time studying, you could learn how to
: shell script.
:
: This clown always gives his shell question posts away by the
: fact that he obviously knows the basic concepts and terminology
: very well indeed.
:
: For the present, we'd all be happy if he would just take his
: meds.
:
: Yes, Matt. We know that it is easy to get an account at a
: computer at any university in the country.
:
: It's only an ignorant script-kitty like you that thinks he is
: being clever when he does it.
:
:
: AC
:







[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 01:16 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register