Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save b159732000/79a16c65339273de064e2eda39b993f8 to your computer and use it in GitHub Desktop.
Save b159732000/79a16c65339273de064e2eda39b993f8 to your computer and use it in GitHub Desktop.

Revisions

  1. @techouse techouse revised this gist May 9, 2019. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions timemachine_exclude_dev_dirs.sh
    Original file line number Diff line number Diff line change
    @@ -8,11 +8,11 @@
    # - vendor
    # - venv
    #
    # Feel free to update to your own needs.
    # Feel free to update this array to your own needs.
    EXCLUDED_DIRECTORIES=( "env" "node_modules" "vendor" "venv" )

    WORK_DIR=$(dirname "${BASH_SOURCE[0]}")
    WORK_DIR=$(realpath "${WORK_DIR}")
    EXCLUDED_DIRECTORIES=( "env" "node_modules" "vendor" "venv" )

    for EXCLUDED_DIRECTORY in "${EXCLUDED_DIRECTORIES[@]}"; do
    find ${WORK_DIR} -maxdepth 2 -type d -name ${EXCLUDED_DIRECTORY} -prune -exec tmutil addexclusion {} \;
  2. @techouse techouse revised this gist May 9, 2019. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions timemachine_exclude_dev_dirs.sh
    Original file line number Diff line number Diff line change
    @@ -10,8 +10,8 @@
    #
    # Feel free to update to your own needs.


    WORK_DIR=$(pwd)
    WORK_DIR=$(dirname "${BASH_SOURCE[0]}")
    WORK_DIR=$(realpath "${WORK_DIR}")
    EXCLUDED_DIRECTORIES=( "env" "node_modules" "vendor" "venv" )

    for EXCLUDED_DIRECTORY in "${EXCLUDED_DIRECTORIES[@]}"; do
  3. @techouse techouse created this gist May 9, 2019.
    19 changes: 19 additions & 0 deletions timemachine_exclude_dev_dirs.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    #!/usr/bin/env bash

    # This simple bash script is aimed at excluding some development specific directories.
    #
    # In this configuration it will instruct Time Machine to exclude directories named:
    # - env
    # - node_modules
    # - vendor
    # - venv
    #
    # Feel free to update to your own needs.


    WORK_DIR=$(pwd)
    EXCLUDED_DIRECTORIES=( "env" "node_modules" "vendor" "venv" )

    for EXCLUDED_DIRECTORY in "${EXCLUDED_DIRECTORIES[@]}"; do
    find ${WORK_DIR} -maxdepth 2 -type d -name ${EXCLUDED_DIRECTORY} -prune -exec tmutil addexclusion {} \;
    done