Advertisement
Guest User

Untitled

a guest
May 19th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. #!/usr/bin/env bash
  2.  
  3. # This simple bash script is aimed at excluding some development specific directories.
  4. #
  5. # In this configuration it will instruct Time Machine to exclude directories named:
  6. # - env
  7. # - node_modules
  8. # - vendor
  9. # - venv
  10. #
  11. # Feel free to update this array to your own needs.
  12. EXCLUDED_DIRECTORIES=( "env" "node_modules" "vendor" "venv" )
  13.  
  14. WORK_DIR=$(dirname "${BASH_SOURCE[0]}")
  15. WORK_DIR=$(realpath "${WORK_DIR}")
  16.  
  17. for EXCLUDED_DIRECTORY in "${EXCLUDED_DIRECTORIES[@]}"; do
  18. find ${WORK_DIR} -maxdepth 2 -type d -name ${EXCLUDED_DIRECTORY} -prune -exec tmutil addexclusion {} \;
  19. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement