[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: Bernhard Voelker
Subject: Re: Small improvement to find's mtime to support for seconds
Date: Tue, 29 Jan 2013 11:28:23 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130105 Thunderbird/17.0.2

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,

reply via email to

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