bug-findutils
[Top][All Lists]
Advanced

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

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


From: James Youngman
Subject: Re: Small improvement to find's mtime to support for seconds
Date: Tue, 29 Jan 2013 21:45:04 +0000

On Tue, Jan 29, 2013 at 8:32 AM, Prashant Sharma <address@hidden> wrote:
> Apologies for not using a proper subject. So changed it!.
>
> 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.

Just use -newermt:

find /tmp -newermt "$(date '+%Y%m%d%H%M%S' -d '30 seconds ago')"

(I didn't test this so the format argument to the date command may be
wrong, the only Linux box I have easy access to now is running
findutils 4.4.2 which is too old to have -newermt).



reply via email to

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