xxxsyncer v0.0.7
=======
同步工具
自动 watch 多个目录的文件,与远程机器同步;
sync.json为配置文件:
可以配置多个path, 每个path下的src所指的文件夹内容会分发同步到对应的dst目录
安装
npm install -g https://github.com/andy12530/nsyncer使用
nsyncer start sync.jsonrsyncer
A continuous rsync runner to keep local and remote directories in sync. It watches the source directory tree for any changes, and immediately invokes the specified rsync command.
install
$ npm install -g rsyncerusage
rsyncer comes with an executable nsyncer(1) that you will use to sync and/or watch your directories/files
$ nsyncer start ./config.jsonapi
command line nsyncer(1)
commands:
start- Start rsyncer- accepts a file path argument to a config file
flags:
-s, --single- Run rsync once, and exit-e, --errexit- Abort script on rsync error-t, --test- Print the rsync command(s) and exit
example
$ nsyncer start ./config.json --single
nsyncer: watch: /Users/jwerle/repos/node-rsyncer/tmp/src/ (watching:true)
nsyncer: sync completersyncer(config)
Accepts a configuration object
paths- An array of objects, each with the following properties:src- The source file or directory to watch.dst- The destination file or directory to write to.disabled- (optional) A boolean to indicate if this job should be ignored (Defaultfalse).
args- (optional) An array of string arguments, that will be passed directly torsync. These will be the default set of args passed to all paths that do not haveargsdefined. Ifargsis defined on both the path, and the top level, only the path'sargswill be used.recursive- A boolean whether to recursively sync paths. (Default:false)delete- A boolean whether delete extraneous files from destination dirs. (Defaultfalse)cvsExclude- A boolean whether auto-ignore files the same way CVS does. (Default:false)links- A boolean whether copy symlinks as symlinks (Default:false)once- A boolean indicating whether to run the rsync command only once. (Default:false)test- Print the rsync command(s) that would be executed and exit. (Default:false)
An example configuration file: config.example.json
contributors
license
MIT
10 years ago