Mail Archives: cygwin/2013/01/08/20:42:47
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
- Raw text -