Created
November 17, 2010 09:02
-
-
Save morgner/703172 to your computer and use it in GitHub Desktop.
Synchronize DIRECTORY from a VOLUME to the scripts location by script name, (here for OSX: look at SRC)
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
#! /usr/bin/env bash | |
VOL=${0##*_} | |
DIR=${0%%_*} | |
SRC="/Volumes/${VOL%.*}/${DIR##*/}" | |
if [ -d "${SRC}" ] | |
then | |
rsync -ah -x --delete --stats --progress --exclude='.DS_Store' "${SRC}" "${0%/*}" | |
else | |
echo "ERROR: Directory '${SRC}' not found" | |
read -sn1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment