Created
February 20, 2020 19:41
-
-
Save toonetown/32c7ef439fc636056d4eeea20e882f32 to your computer and use it in GitHub Desktop.
A script which automatically will exclude build directories from time machine
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
#!/bin/bash | |
: ${BASEDIR="${HOME}/Documents/Programming"} | |
: ${MAXDEPTH=6} | |
find "${BASEDIR}" -maxdepth ${MAXDEPTH} -type f \( -name pom.xml -o -name build\.sh \) -print0 \ | |
| while read -d $'\0' _f; do | |
find "$(dirname "${_f}")" -maxdepth 1 -type d \( -name target -o -name build \) -exec tmutil addexclusion {} \; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment