Permalink
Browse files

Merge pull request #17 from Klortho/rsync-opts

Add ability to set rsync options with an environment variable
  • Loading branch information...
2 parents f454ea9 + cfce6d1 commit 8e5fd1ee3ea264426f5f4fae9f1af03739bf4568 @ggreer committed Apr 1, 2016
Showing with 9 additions and 3 deletions.
  1. +7 −2 README.md
  2. +2 −1 autorsync
View
@@ -36,9 +36,14 @@ Automatically rsync files to a remote server if any of them are changed.
autorsync . 192.168.1.127:/var/www
-Same as above, but don't copy .pyc files.
+The above invokes `rsync` with `-avz` (archive mode, verbose, compress). To
+pass additional arguments to `rsync`, for example:
- notifyloop ~/code/directory rsync -avz --exclude="*.pyc" ~/code/directory/ server.example.com:/stuff/
+ RSYNC_OPTS='--exclude="*.pyc"' autorsync . 192.168.1.127:/var/www
+
+To do the same thing "manually":
+
+ notifyloop . rsync -avz --exclude="*.pyc" . 192.168.1.127:/var/www
## Building from source
View
@@ -9,5 +9,6 @@ fi
WATCH_PATH="$1"
shift
DEST=("$@")
+rsync_opts=( $RSYNC_OPTS )
-notifyloop "$WATCH_PATH" rsync -avz "$WATCH_PATH" "${DEST[@]}"
+notifyloop "$WATCH_PATH" rsync -avz "${rsync_opts[@]}" "$WATCH_PATH" "${DEST[@]}"

0 comments on commit 8e5fd1e

Please sign in to comment.