Mac OS X,  Mac OS X Server,  Mac Security,  Xsan

Hey Spotlight, Skip This Folder…

Whether it’s an Xsan with a wacky mdworker thread, a regular old box trying to scan a whole bunch of files you want it to skip or even a directory that you want to keep private, you can tell Spotlight not to scan a specified folder on your system. Simply use the following command, with the working directory of the shell as whatever directory you want skipped:

touch .metadata_never_index

In other words, create a file called .metadata_never_index in a folder and Spotlight will skip it. This isn’t to say it skips subfolders…