SHARE
TWEET

Untitled

a guest May 19th, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top