sarbbottam / watch-and-rsync

watch and rsync directory across system

Home Page:http://npm.im/watch-and-rsync

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

watch-and-rsync

watch and rsync directories across system

Build Status version downloads MIT License PRs Welcome

Usage

npm i watch-and-rsync -g

watch-and-rsync -o=start -c=path/to/the/config.js

watch-and-rsync -o=stop -c=path/to/the/config.js

watch-and-rsync -o=list
// config.js
module.exports = {
  'source': 'path/to/the/source/',
  'target': 'path/to/the/target/',
  'host': 'IP or hostname',
  'excludes': [
    '.git', // for faster syncing
    'build',
    'dist',
    'logs',
    'node_modules',
    'tmp',
    ...
  ]
}

demo - gif

Why?

I work across Mac and Linux. I am neither a vim nor an emacs pro, and thus code in Mac as the Linux boxes are on demand and has only ssh access. But my run time is in Linux, :sigh: not using docker yet.

So far, I have been using launchctl and .plist along with a .sh to watch a desired directory and sync it across the desired Linux system.

Why JavaScript?

Some how, I managed to get the launchctl and .plist working, I don't understand it completely. It's a nightmare when I want to tweak it, thus JavaScript, which I comprehend much better.

About

watch and rsync directory across system

http://npm.im/watch-and-rsync

License:MIT License


Languages

Language:JavaScript 100.0%