Created
April 8, 2014 23:40
-
-
Save eegrok/10209444 to your computer and use it in GitHub Desktop.
locate.updatedb on osx as root instead of nobody user -- indexes home directory files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# comment out this region to index as root according to: | |
# http://apple.stackexchange.com/questions/84532/how-can-i-search-my-entire-drive-for-a-file-without-getting-recursively-stuck-in/84556#84556 | |
# if [ "$(id -u)" = "0" ]; then | |
# rc=0 | |
# export FCODES=`mktemp -t updatedb` | |
# chown nobody $FCODES | |
# tmpdb=`su -fm nobody -c "$0"` || rc=1 | |
# if [ $rc = 0 ]; then | |
# install -m 0444 -o nobody -g wheel $FCODES /var/db/locate.database | |
# fi | |
# rm $FCODES | |
# exit $rc | |
# fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment