[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Small improvement to find's mtime to support for seconds

From: Prashant Sharma
Subject: Re: Small improvement to find's mtime to support for seconds
Date: Tue, 29 Jan 2013 19:42:34 +0530

you are right about the race condition point. And it is not generating huge
amount of files in short time, my take was to delete them as soon as
possible accumulating and then deleting can lead to a longer pause.

inotify sounds interesting too. :)

But you still think something that gives precision of seconds is not worth
it ? Given an hypothetical situation where I have time since epoch and for
some reason I want the files which qualifies this criteria for debugging or
if precision of time range in seconds can simply narrow down my search to
fewer files. Something like this might be handy !

On Tue, Jan 29, 2013 at 3:58 PM, Bernhard Voelker

> On 01/29/2013 09:32 AM, Prashant Sharma wrote:
> > On Tue, Jan 29, 2013 at 1:54 PM, Prashant Sharma <address@hidden
> >wrote:
> >
> >> The need for this arose with following scenario.
> >> I have stream processing engine doing some random stuff and creating a
> lot
> >> of files in the process. And since I did not wrote it myself and people
> who
> >> wrote it do not have clearing up mechanism for the files that accumulate
> >> and tend to either fill Inodes or File-system.
> >>
> >> So needed a way for clearing things up older than 30 seconds. Ofcourse I
> >> can touch a dummy file and then sleep for 30 seconds and then use find
> >> -newer. But that sounds like so much for so less and for that matter,
> one
> >> can parse the output of stat in perl or even in bash and do the same
> thing.
> >> In this case a single line command might sound like an improvement.
> Ohh, that sounds like a wacky hack for a severely broken software,
> and I guess you might run into other problems like races: if that software
> is really constantly creating so many temporary files in a short time,
> then you could probably lock up the server with additional find processes
> searching over all these files which run every 30 seconds.
> In such a special case, I'd rather try to immediately delete the file
> after closing with some inotify script.
> Have a nice day,
> Berny


reply via email to

[Prev in Thread] Current Thread [Next in Thread]