Last active
August 29, 2015 14:05
-
-
Save breun/2c3e048e5289ec7b27c9 to your computer and use it in GitHub Desktop.
Exclude Maven target directories from Time Machine backup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Exclude all paths for directories named 'target' in the ~/Projects directory (which I use for my Maven projects) | |
# Sticky excludes (without -p and sudo) are not that useful, because 'mvn clean' removes the target directory | |
find ~/Projects -type d -name target | xargs sudo tmutil addexclusion -p | |
# List all items excluded by path | |
plutil -convert xml1 -o - /Library/Preferences/com.apple.TimeMachine.plist | xmllint -xpath /plist/dict/array[2] - | |
# List all items with sticky excludes | |
mdfind "com_apple_backup_excludeItem = com.apple.backupd" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There's also a Maven plugin which excludes the target directory from Time Machine back-up, but currently it's giving me an error: http://snippets.syabru.ch/maven-timemachine-plugin/