Skip to content

Instantly share code, notes, and snippets.

@littlebenlittle
Last active November 17, 2019 16:11
Show Gist options
  • Save littlebenlittle/3867e9cca69d12c07ebfc6a216854264 to your computer and use it in GitHub Desktop.
Save littlebenlittle/3867e9cca69d12c07ebfc6a216854264 to your computer and use it in GitHub Desktop.
Sync files to a cloud VM
LOCAL_DIR=$1
REMOTE_DIR=$2
DEV_IP=$3
while inotifywait -e modify -e create --exclude '/\..+' -r $LOCAL_DIR; do
rsync -avz --exclude '/\..+' $LOCAL_DIR $USER@$DEV_IP:$REMOTE_DIR
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment