2.6.3 • Published 7 years ago

rsynconfig v2.6.3

Weekly downloads
6
License
MIT
Repository
github
Last release
7 years ago

NPM version Build status Lib dependences Commits License

rsynconfig

One config file for all rsync.

Installation

npm: npm i -g rsynconfig

yarn: yarn global add rsynconfig

make: make > uses npm under the hood

Usage

Run rsynconfig -h for more information about CLI arguments

Create template '.rsynconfig.toml' file

rsynconfig init

Example

Edit or create .rsynconfig.toml file into root of the project:

exclude = ['.rsync-filter']

[[destinations]]
name = 'sshtest'
src = './dir0/'
delete = false
flags = 'u'
[destinations.ssh.dest]
  host = 'localhost'
  user = 'lil'
  path = '/dir1/'
  key = './my.key'

[[destinations]]
name = 'localtest'
src = 'dir0/'
dest = 'dir1/'
delete = true
flags = 'dra'

Examples by others

Please contact me I would love to have more examples.

Run synchronization

rsynconfig run localtest

# dry run
rsynconfig dry localtest

# name can be a glob to run multiple
rsynconfig run *test

# async run
# possibly handy for remote synchronization with large files
rsynconfig async localtest

# restore
# restore files from given dest to src
# delete is always false; flags is 'a'
rsynconfig restore localtest

Config file options

nametype(s)defaultdescriptionexample value (.toml)
nameStringname of destination in destinations array[[destinations]]¬ name = 'test'
srcStringlocal rsync sourcesrc = '/media/$USER/data/test/'
destStringlocal rsync destinationdest = '$HOME/test/'
ssh.(dest/src).hostStringssh host[destinations.ssh.dest]¬ host = 'localhost'
ssh.(dest/src).userStringssh user[destinations.ssh.dest]¬ user = 'alex'
ssh.(dest/src).pathStringssh root path[destinations.ssh.dest]¬ path = '/www'
ssh.(dest/src).keyStringssh optional key[destinations.ssh.dest]¬ key = '$HOME/ssh.key'
flagsBooleandrrsync flagsflags = 'au'
deleteBooleanfalsedelete flagdelete = true
excludeString or Arrayexclude filesexclude = ['/A*']
includeString or Arrayde-exclude filesinclude = ['/Anna']
filterBooleantruesearches for .rsync-filter filesfilter = true
dryBooleanfalsersync flagsdry = false
chmodStringpermission of the files in the transferchmod = '+x'

Not Another Markup Language (NAML)

Using -c <filename>.<exten> you can make your config file under the following extentions:

  • json
  • hjson
  • json5
  • cson
  • yaml
  • toml
  • ini

Nodejs Module

const rsynconfig = require('rsynconfig')

rsynconfig(configFile, destinationsName, cwd)
.then((result) => {
  // result.names[...]
  // result.logs[...]
})
.catch(error => {
  if (error) {
    DEBUG
    ? console.error(error.message)
    : console.error(error.stack);
  }

  // ..
})

Globals are used for log verbosity

global.DEBUG = true
global.QUIET = false

License

MIT.

2.6.3

7 years ago

2.6.2

7 years ago

2.6.1

7 years ago

2.6.0

7 years ago

2.5.1

7 years ago

2.5.0

7 years ago

2.4.2

7 years ago

2.4.1

7 years ago

2.4.0

7 years ago

2.3.0

7 years ago

2.2.1

7 years ago

2.2.0

7 years ago