Skip to content

Instantly share code, notes, and snippets.

@bdowling
Created February 11, 2019 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bdowling/de52b4ba58cd8aec3dfe04ee0b73c5d5 to your computer and use it in GitHub Desktop.
Save bdowling/de52b4ba58cd8aec3dfe04ee0b73c5d5 to your computer and use it in GitHub Desktop.
#!/bin/sh
#
# Simple script to watch a source folder for changes and run rsync on demand as changes occur
#
SRC=$1
DEST=$2
while true; do
inotifywait --exclude=.git -r --event=modify,create,move,delete $SRC && rsync -Pav --exclude=.git $SRC $DEST
sleep 5;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment