Created
July 25, 2020 15:36
-
-
Save mikehouse/c18170d3016522444638176fdcc6a262 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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