Skip to content

Instantly share code, notes, and snippets.

@smikheiev
Last active May 16, 2018 21:07
Show Gist options
  • Save smikheiev/2e80ed1c7eab83b0cdbdeba97504c31b to your computer and use it in GitHub Desktop.
Save smikheiev/2e80ed1c7eab83b0cdbdeba97504c31b to your computer and use it in GitHub Desktop.

Script to exclude node_modules in projects folder from Time Machine backup

#!/bin/zsh
cd ~/projects
find `pwd` -maxdepth 3 -type d -name 'node_modules' | xargs -n 1 tmutil addexclusion
mdfind "com_apple_backup_excludeItem = 'com.apple.backupd'" | grep "node_modules"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment