From owner-freebsd-questions@FreeBSD.ORG Thu Jul 10 17:05:49 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D8DE1065673 for ; Thu, 10 Jul 2008 17:05:49 +0000 (UTC) (envelope-from remegius@comcast.net) Received: from QMTA02.emeryville.ca.mail.comcast.net (qmta02.emeryville.ca.mail.comcast.net [76.96.30.24]) by mx1.freebsd.org (Postfix) with ESMTP id 2FC6D8FC21 for ; Thu, 10 Jul 2008 17:05:49 +0000 (UTC) (envelope-from remegius@comcast.net) Received: from OMTA01.emeryville.ca.mail.comcast.net ([76.96.30.11]) by QMTA02.emeryville.ca.mail.comcast.net with comcast id oB8d1Z00Y0EPchoA2H5oGb; Thu, 10 Jul 2008 17:05:48 +0000 Received: from localhost ([67.188.180.64]) by OMTA01.emeryville.ca.mail.comcast.net with comcast id oH5n1Z00N1PlroK8MH5no9; Thu, 10 Jul 2008 17:05:48 +0000 X-Authority-Analysis: v=1.0 c=1 a=FDMsFL4uIQxTA3UnmeIA:9 a=wiCilRN2BsMbvJzRoXUA:7 a=G4sRrCr02KQcT2X7ocYrH39FgXoA:4 a=MxZ3bB5I4kYA:10 Date: Thu, 10 Jul 2008 10:05:46 -0700 From: Rem P Roberti To: Matthew Seaman Message-ID: <20080710170546.GA959@remdogbsd> Mail-Followup-To: Matthew Seaman , Daniel Gerzo , Roger Olofsson , FreeBSD Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.3i Cc: Daniel Gerzo , FreeBSD , Roger Olofsson Subject: Re: Locate command X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jul 2008 17:05:49 -0000 > Rem P Roberti wrote: > >>Hello, > >> > >>>>Actually, the very first thing I always do after installing a FreeBSD is > >>>>add this line to crontab: > >>>> > >>>>00 02 * * * /usr/libexec/locate.updatedb > >>>> > >>>>I guess I'm a locate-freak ;^D > >>>> > >>>Done. Thanks again. > >>You guys should rather use /etc/periodic/weekly/310.locate script > >>to update your locate database. > > > >I'm pretty new to all of this, so how does one go about invoking that > >script? > > Well, to run it by hand you type: > > /etc/periodic/weekly/310.locate > > Otherwise it will be run automatically by the periodic(8) system. > It is enabled by default: > > happy-idiot-talk:~:% grep locate /etc/defaults/periodic.conf > # 310.locate > weekly_locate_enable="YES" # Update locate > weekly > > You can create a file /etc/periodic.conf to control turning on > or off or to tweak parameters for any of the periodic scripts. > > As the name suggests it's a weekly script, and if you look at > /etc/crontab you will see the line: > > 15 4 * * 6 root periodic weekly > > Or in other words, it runs at around 4:15am on Saturdays. > > If you wanted to run it every day, then you'ld copy it to > /usr/local/etc/periodic/daily/310.locate, globally substitute > daily_locate for weekly_locate eg. by: > > sed -i.bak -e 's/weekly_locate/daily_locate/' \ > /usr/local/etc/periodic/daily/310.locate > > and then put both 'daily_locate_enable="YES"' and > 'weekly_locate_enable="NO"' into /etc/periodic.conf > > In this case it would be run by the periodic system like so: > > 1 3 * * * root periodic daily > > that is: at 3:01am every day. > > Cheers, > > Matthew > Thanks to folks like you, Matthew, I'm slowly, but surely, learning this stuff. Rem