At 20:55 -0500 10/8/06, Ken Williams wrote:
 locate gluemac

While on this topic, one of the first things I do to any newly installed Mac that I will use is to move the locate database update from weekly to daily and remove the "run as nobody" so it runs as root (otherwise it does not see any of my own files!).

Add /etc/daily.local:

#!/bin/sh -
#
#       @(#)daily       8.2 (Berkeley) 1/25/94
#
PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin

if [ -x /usr/libexec/locate.updatedb ]; then
    echo ""
    echo "Rebuilding locate database:"
    locdb=/var/db/locate.database
    touch "${locdb}"; chown nobody "${locdb}"; chmod 644 "${locdb}"
# echo /usr/libexec/locate.updatedb | nice -5 su -fm nobody 2>&1 | sed -e '/Permission denied/d'
    /usr/libexec/locate.updatedb
    chmod 444 "${locdb}"
fi

Delete the locate.updatedb code from /etc/weekly (unfortunately, you have to do this to avoid it clobbering the good database with the bad database for up to one day a week).

After this, locate works like Spotlight should, ie finds everything, finds it very fast.

Eg, "locate s3 | grep pdf" - find the Amazon S3 documentation (| xargs bbedit for good measure ;-)

Enjoy,
   Peter.

--
Check out Interarchy 8.1.1, just released, now with Amazon S3 support.
<http://www.stairways.com/>  <http://download.stairways.com/>

Reply via email to