Last active
May 27, 2026 09:51
-
Star
(141)
You must be signed in to star a gist -
Fork
(14)
You must be signed in to fork a gist
-
-
Save peterdemartini/4c918635208943e7a042ff5ffa789fc1 to your computer and use it in GitHub Desktop.
Exclude node_modules in timemachine
This file contains hidden or 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
| find `pwd` -type d -maxdepth 3 -name 'node_modules' | xargs -n 1 tmutil addexclusion |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This works for me
mdfind "kMDItemFSName == 'node_modules'" > /tmp/node_modules_paths.txt && sudo /bin/zsh -c 'while IFS= read -r p; do [ -d "$p" ] && tmutil addexclusion -p "$p"; done < /tmp/node_modules_paths.txt'