rsyncer

Continuous rsync runner.

rsyncer

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.

$ npm install -g rsyncer

rsyncer comes with an executable nsyncer(1) that you will use to sync and/or watch your directories/files

$ nsyncer start ./config.json

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 complete

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 (Default false).
  • args - (optional) An array of string arguments, that will be passed directly to rsync. These will be the default set of args passed to all paths that do not have args defined. If args is defined on both the path, and the top level, only the path's args will be used.

  • recursive - A boolean whether to recursively sync paths. (Default: false)

  • delete - A boolean whether delete extraneous files from destination dirs. (Default false)

  • 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

MIT