Skip to content

Instantly share code, notes, and snippets.

@lhotari
Last active October 26, 2016 21:25
Show Gist options
  • Save lhotari/07e4c206673b85d13a3318c802b8591c to your computer and use it in GitHub Desktop.
Save lhotari/07e4c206673b85d13a3318c802b8591c to your computer and use it in GitHub Desktop.
#!/bin/bash
# Disables Spotlight / mdworker and Time Machine backups for all build and .gradle directories under the working directory.
/usr/bin/find . '(' -name build -or -name .gradle ')' -exec touch "{}/.metadata_never_index" \;
/usr/bin/find . '(' -name build -or -name .gradle ')' -exec xattr -w com.apple.metadata:com_apple_backup_excludeItem com.apple.backupd "{}" \;
@lhotari
Copy link
Author

lhotari commented Oct 26, 2016

Disables Spotlight / mdworker and Time Machine backups for all build and .gradle directories under the working directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment