X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Message-ID: <50ECCB01.7090804@etr-usa.com> Date: Tue, 08 Jan 2013 18:42:25 -0700 From: Warren Young User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Cygwin-L Subject: updatedb.local Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com I've just set up locate(1) for the first time. The default configuration of updatedb doesn't scan all of C:, only c:\cygwin, so I did the obvious thing and got spammed by permission denied errors. Rather than cope by indexing the disk as Administrator, I decided to just start adding exclusions. The list grew long enough that I decided I should share the result to save someone else the pain of recreating it: #!/bin/sh updatedb --localpaths='/c /' \ --prunepaths=' .*Logs .*/LogFiles .*Temp .*Tmp /c/cygwin /c/$Recycle.* /c/PerfLogs /c/ProgramData /c/Recovery /c/System.* /c/Program.*/WindowsApps /c/Program.*/.*/CrashReports /c/Users/Administrator /c/Users/cyg_server /c/Users/Public /c/Windows/AppCompat/Programs /c/Windows/AUInstallAgent /c/Windows/CSC /c/Windows/LiveKernelReports /c/Windows/Minidump /c/Windows/PLA /c/Windows/Prefetch /c/Windows/Resources/Themes /c/Windows/ServiceProfiles /c/Windows/security /c/Windows/ServiceProfiles /c/Windows/Sys.*/Com/dmp /c/Windows/Sys.*/config /c/Windows/Sys.*/MsDtc /c/Windows/Sys.*/networklist /c/Windows/Sys.*/sru /c/Windows/Sys.*/Tasks /c/Windows/WinSxS /c/Windows.old /proc /tmp /usr/tmp /var/tmp' Note that it's written with the assumption that you hack away the 'cygdrive' stuff in /etc/fstab. Most of the exclusions are just system directories of one sort or another, which Windows wants to hide away from you. I've added the usual assortment of temp, log and trash directories, in addition to the ones at the end which recapitulate the defaults, except for /afs which doesn't exist on Cygwin. There's a minor trick of including / but excluding /c/cygwin, so searches for files in the Cygwin tree don't show up twice. I've excluded WinSxS, even though it's readable, because it just contains backups of files that normally live elsewhere. When you go looking for one of the files it mirrors, you almost certainly want to find the canonical copy only. Some of the excluded directories won't exist on all systems, but are common enough that I felt comfortable leaving them in the public version of this script. (e.g. Google Chrome's CrashReports folder, Windows.old...) I welcome additions to the exclusion list. Maybe this script can show up in a future findutils release, with a note about it in /usr/share/doc/Cygwin/findutils.README? -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple