Watch a local path and sync to another location (for example a remote host on the network) via rsync.
Useful for developing on one machine while running the application on another one.
rsync
has to be installed on both machinesfswatch
has to be installed on local machine
- Clone repo
- Create a symlink in a directory that is part of $PATH. For example in
/usr/local/bin
and give it an alias for examplersync-watch
rsync-watch SOURCE DESTINATION [OPTIONS]
--exclude
comma-separated list of paths to ignore. This option will get passed to rsync and fswatch.
rsync-watch my-app-folder 192.168.1.1::desktop --exclude=my-app-folder/node_modules,my-app-folder/.env
This will sync the local folder my-app-folder
to a remote host in the local network
with a virtual directory or module called desktop
while ignoring all files in the
node_modules folder and the environment file.