• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Efficient replacement for "find"?

homercles337

Diamond Member
My group is having to do instances of find for a mod date on a filesystem with millions of files. A single "run" of this can take 10 hours. So, is there a more efficient option? Or is the call to "stat" going to always kill this kind of search? Thanks.
 
As far as a straight speed search I can't think of anything faster than find. Its pretty lightweight as is. If the files you are scanning are spread across multiple disks you could run find's in parallel on each one assuming you aren't CPU bound.

With that said, depending on what you are trying to accomplish there could be mechanisms that you could implement to make this type of thing more efficient. Something like a memcache installation leveraging inotify/gamin could keep track of file system changes, or leveraging audit. I've never done anything like this on a file system with millions of files, so testing would be needed.

What is your use case? If this is just a one time investigation, writing the mod dates to a file would probably make successive searches a bit faster.
 
Last edited:
Back
Top