How to exclude directories from Mozy custom backup sets using spotlight queries

1

I would like to create custom backup sets for Mozy which exclude certain directories. For example, I would like to backup my Itunes folder, but exclude all podcasts. I have created a backup set which searches in /Users/me/Music and used this query

kMDItemPath == "*Podcasts*"wc

to exclude all matching files. However, nothing matches. Queries which use the kMDItemFSName spotlight attribute work fine, but any query using kMDItemPath doesn't seem to work at all. What am I doing wrong?

ubiyubix

Posted 2009-08-16T13:38:08.333

Reputation: 133

Answers

1

Answered here in StackOverflow (I'm quoting kperryua):

Quoth the documentation:

kMDItemPath

Complete path to the file. This value of this attribute can be retrieved, but can't be used in a query or to sort search results.

Link

That means that the attribute kMDItemPath can only be used with a MDItem or NSMetadataItem to retrieve the path for an item already found. You cannot use it with an MDQuery or an NSMetadataQuery within the query predicate you specify to find files.

pinko

Posted 2009-08-16T13:38:08.333

Reputation: 124

1Bummer! But thanks for the answer. – ubiyubix – 2010-06-26T15:14:53.123