Skip to content

Instantly share code, notes, and snippets.

@mikehouse
Created July 25, 2020 15:36
Show Gist options
  • Save mikehouse/c18170d3016522444638176fdcc6a262 to your computer and use it in GitHub Desktop.
Save mikehouse/c18170d3016522444638176fdcc6a262 to your computer and use it in GitHub Desktop.
RAM_DISK=/Volumes/ramdisk
if [[ ! -d $RAM_DISK ]]; then
exit 0
fi
PROJECT_ROOT=$HOME/Development
PROJECT_ROOT_RSYNC=$PROJECT_ROOT/rsync
if [[ ! -d $PROJECT_ROOT_RSYNC ]]; then
mkdir -p $PROJECT_ROOT_RSYNC
fi
for proj in "My Project"; do
if [[ -d $PROJECT_ROOT_RSYNC/$proj/ ]]; then
if [[ ! -d $RAM_DISK/$proj ]]; then
cp -pR $PROJECT_ROOT_RSYNC/$proj/ $RAM_DISK/$proj
else
echo "skip copying of $proj as already exists."
fi
echo "rsync $RAM_DISK/$proj to $PROJECT_ROOT_RSYNC"
rsync -a $RAM_DISK/$proj $PROJECT_ROOT_RSYNC --delete
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment