I am on MacOS Catalina. locate
is a great command but unfortunately, I have difficulties to find files which have been created for example one hour ago or ten minutes ago.
It seems that I could circumvent this issue by updating the database with a higher frequency than every 24 hours.
But the other problem is that, when I launch the command /usr/libexec/locate.updatedb
in root, it lasts much time before this command ends.
So I conclude that update rebuilds completly the database and doesn't update only the new files created from last locate.updateb
execution : indeed, this would be a big gain of time if the command was not rebuilding all the database with all the files of the system.
Finally, I think about a simple strategy : modidy
/System/Library/LaunchDaemons/com.apple.locate.plist
to force it to update for example the database every 5 minutes. But if the command /usr/libexec/locate.updatedb
rebuilds all the database every 5 minutes, this doesn't make sense.
So, I would like to get feedback from people who have this kind of problem and how they solved it. I prefer to avoid using the command mdfind
but if there is not available solution with locate and not the possibility not to have to rebuild all content each time (in my case, this would be each five minutes), I would be obliged to switch to mdfind
.
By the way, a simple crontab launching every 5 minutes the command /usr/libexec/locate.updatedb
is also allowed, isn't it ?
You could also advise me to use find
with -mtime
flag but find is very slow (associated with parallel
, it might be an alternative, I don't know, actually, I am a locate
fan since I have used it a lot on Linux).
Any clue/remark/feedback are welcome,
Regards
mdfind
command?