Advertisement
Guest User

Untitled

a guest
Jul 25th, 2017
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # place this into your development directory (usually ~/Sites)
  4.  
  5. dir=$(cd `dirname $0` && pwd)
  6.  
  7. directories=(vendor node_modules temp log)
  8.  
  9. for dirname in "${directories[@]}"
  10. do
  11. # -maxdepth 2 can be changed to other depth or removed completely
  12. for d in `find $dir -maxdepth 2 -type d -name $dirname`
  13. do
  14. `tmutil isexcluded $d | grep -q "Included"`
  15. if [ $? -eq 0 ]; then
  16. # -p can be removed so that given directory is not fixed, but rather mark directory itself as excluded no matter where you move it
  17. tmutil addexclusion -p $d
  18. echo "Dir $d is excluded now"
  19. fi;
  20. done
  21. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement