0

I'm running the following command:

updatedb -l 0 -o mydatabase.db -U /usr/myfiles1/

Then,

locate -d mydatabase.db ""

The "" are to show all the contents of mydatabase.db. However, I'm missing files that I'd expect to see in /myfiles1/. 'locate' doesn't seem to be recursing down through the directories. I've checked permissions, but it seems random as to what directories 'locate' chooses to recurse down into.

If I 'cd' to 'myfiles1' and then run 'updatedb', it recurses down into this directory and its subdirectories and generates all the files contained in /myfiles1/.

  • If you run updatedb with -v it should list the files it is finding, and this might provide a clue. – meuh Apr 24 '19 at 9:20
  • I tried this. It is skipping over a bunch of directories without recursing down into them. – macdays Apr 24 '19 at 21:59
1

The reason I wasn't able to recurse down into the subdirectories when updating the locate database, was because I didn't have the proper permissions for the top-level directories. Running updatedb as root was able to crunch through the whole file tree without skipping directories regardless of where I kicked of the updatedb command.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.