This discussion is locked
Andy Highberger

Q: 'locate' question

I guess 'locate' is 'off' by default in 10.6.1. I went to 'locate' something and I got this"


<pre style="
font-family: Monaco, 'Courier New', Courier, monospace;
font-size: 10px;
font-weight: normal;
margin: 0px;
padding: 5px;
border: 1px solid #000000;
width: 720px;
color: #000000;
background-color: #FFDDFF;
overflow: auto;">
WARNING: The locate database (/var/db/locate.database) does not exist.
To create the database, run the following command:

  sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.locate.plist

Please be aware that the database can take some time to generate; once
the database has been created, this message will no longer appear.
</pre>


I found that to be a remarkably helpful error message, and I followed the given instructions. My question is, Will that survive a restart, or will I have to issue the command each time I restart? And, will the 'weekly' task regularly update the locate database?

Thanks for looking.
Andy

Message was edited by: Andy Highberger

Message was edited by: Andy Highberger

Message was edited by: Andy Highberger

2.93 Ghz Quad MacPro G5 Dual 2.7 GHz, MBPro 2.5 GHz, iMac C2D, Mac OS X (10.6.1), PowerMac G4, Ti MacBook 867 MHz, WallStreet PB, FatMac 512KB

Posted on Oct 6, 2009 10:13 AM

Close

Q: 'locate' question

  • All replies
  • Helpful answers

  • by Camelot,Solvedanswer

    Camelot Camelot Oct 6, 2009 10:17 AM in response to Andy Highberger
    Level 8 (47,285 points)
    Mac OS X
    Oct 6, 2009 10:17 AM in response to Andy Highberger
    Will that survive a restart, or will I have to issue the command each time I restart?


    The fact you use the -w switch with launchctl writes the change to the preference file and therefore it is persistent (i.e. it will re-enable after a reboot.

    And, will the 'weekly' task regularly update the locate database?


    What 'weekly' task are you referring to?
    launchd will periodically relaunch the task to update the database. You can control this in the .plist:

    <key>StartCalendarInterval</key>
    <dict>
    <key>Hour</key>
    <integer>3</integer>
    <key>Minute</key>
    <integer>15</integer>
    <key>Weekday</key>
    <integer>6</integer>
    </dict>


    i.e. run at 3:15am every Saturday morning.
  • by Andy Highberger,

    Andy Highberger Andy Highberger Oct 6, 2009 10:32 AM in response to Camelot
    Level 2 (445 points)
    Oct 6, 2009 10:32 AM in response to Camelot
    Thanks so much Camelot!

    I really have not understood launchd and only had enough understanding of cron to be dangerous. Thank you for explaining it to me.

    The 'weekly' task I refer to is the weekly maintenance task that used to update the 'whatis' database and the 'locate' database, but now only lists the 'whatis' database in the 'weekly.out' log in /privat/var/log. It sounds like from your explanation that launchd will update the database weekly with no further input from me.

    Thank you for your patience
    Andy

    p.s. how do you format the text in your first example in your post? The one that starts 'Will that survive...'
  • by Camelot,Helpful

    Camelot Camelot Oct 6, 2009 1:21 PM in response to Andy Highberger
    Level 8 (47,285 points)
    Mac OS X
    Oct 6, 2009 1:21 PM in response to Andy Highberger
    p.s. how do you format the text in your first example in your post? The one that starts 'Will that survive...'


    Just precede the paragraph with a >, e.g.:

     > This text will be quoted

    yields:

    This text will be quoted
  • by Andy Highberger,

    Andy Highberger Andy Highberger Oct 7, 2009 7:04 AM in response to Camelot
    Level 2 (445 points)
    Oct 7, 2009 7:04 AM in response to Camelot
    Thanks again Camelot,

    Although I was expecting some 42 line script or something.


    I appreciate your contribution to these discussions

    Andy