On 01/29/2013 09:32 AM, Prashant Sharma wrote:
> On Tue, Jan 29, 2013 at 1:54 PM, Prashant Sharma <[email protected]>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