Thread: slocate doesn't seem to work
i've found information slocate here: https://help.ubuntu.com/community/findingfiles#locate
have installed slocate package. i've manually run daily cron job:
i have given hour index 1 tb of data. not seem indexing of filesystems:code:david@growler:~$ sudo /etc/cron.daily/slocate david@growler:~$
i have many files in /media directory , subdirectories "address" in them.code:david@growler:~$ locate address /usr/share/doc/ifupdown/examples/check-mac-address.sh /usr/share/doc/ifupdown/examples/get-mac-address.sh /usr/share/doc/libncurses5-dev/html/ada/terminal_interface-curses-forms-field_types-ipv4_address__adb.htm /usr/share/doc/libncurses5-dev/html/ada/terminal_interface-curses-forms-field_types-ipv4_address__ads.htm /usr/src/linux-headers-2.6.24-27-server/include/config/mtd/docprobe/address.h /usr/src/linux-headers-2.6.24-27-server/include/config/mtd/nand/diskonchip/probe/address.h /usr/src/linux-headers-2.6.24-27-server/include/config/scsi/sym53c8xx/dma/addressing /usr/src/linux-headers-2.6.24-27-server/include/config/scsi/sym53c8xx/dma/addressing/mode.h /usr/src/linux-headers-2.6.24-28-server/include/config/mtd/docprobe/address.h /usr/src/linux-headers-2.6.24-28-server/include/config/mtd/nand/diskonchip/probe/address.h /usr/src/linux-headers-2.6.24-28-server/include/config/scsi/sym53c8xx/dma/addressing /usr/src/linux-headers-2.6.24-28-server/include/config/scsi/sym53c8xx/dma/addressing/mode.h david@growler:~$
problem? cron job looks like:
code:david@growler:~$ more /etc/cron.daily/slocate #! /bin/sh if [ -x /usr/bin/slocate ] && [ ! -x /usr/bin/mlocate ] if [ -f /etc/updatedb.conf ] . /etc/updatedb.conf fi # adjust i/o priority of current process (default: best effort) ionice -c ${ionice_class:-2} -n ${ionice_priority:-7} -p $$ if [ -f /etc/updatedb.conf ] nice -n ${nice:-10} /usr/bin/slocate -u else nice -n ${nice:-10} /usr/bin/slocate -u -f proc fi chown root.slocate /var/lib/slocate/slocate.db fi david@growler:~$
i think working. try this: create test file in home directorylook using slocatecode:touch ~/updatedb.testthis should fail have not updated slocate database. update slocatecode:locate updatedb.testnow test locate againcode:sudo updatedbthe file should found.code:locate updatedb.test
Forum The Ubuntu Forum Community Ubuntu Specialised Support Ubuntu Servers, Cloud and Juju Server Platforms [ubuntu] slocate doesn't seem to work
Ubuntu
Comments
Post a Comment