Currently I'm repeatedly doing a 'find' that's too slow. I'm searching for non-hidden executable files within "$root", excluding "$root/bin":
find "$root" -type f -perm -o+x -not -path "$root/bin/*" \( ! -regex '.*/\..*' \)
I'd like to restrict find to only look in directories with mtimes older than a certain time. I still want it to recurse into old directories' subdirectories, but I don't want it to check the regular files inside unless the directory passes my mtime check. Is it possible to do this with GNU find or do I need two invocations, one to find the directories and another to check the files inside?
stat
that makes things slow. And to recurse into subdirectories, it'll have tostat
each file to see whether it's a directory or not. Or is it OK to prune the whole directory tree if one of its ancestors is too new?