'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:05 AM

Reply
4 replies

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.

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...'

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

'locate' question

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.