#!/bin/bash watch_path="proxy/src/" run_rsync() { rsync -azPv -e ssh \ --exclude ".*/" --exclude ".*" \ --exclude "tmp/" --exclude "target/" \ "$watch_path" eliza@ares.local:conduit/proxy/src } run_rsync; fswatch -o "$watch_path" | while read -r f; do run_rsync; done