sendman

CLI tool for sending files to a local/remote location


Sendman is a CLI tool for sending files to a local/remote location.

This is handy when you want to use a configuration file to define the local/remote server host, port, username, password, local path, and remote path of the files you want to send via FTP, SCP, or rsync.

npm install -g sendman

Create a sample .sendman.json configuration file:

sendman init

Configuration file contains:

{
  "protocol": "scp",
  "host": "somehost",
  "port": 22,
  "username": "someusername",
  "password": "somepassword",
  "local": "/path/to/local/dir",
  "remote": "/path/to/remote/dir"
}

Send the files at configured local path:

sendman send

If .sendman.json is stored in a public SCM, it's better to store username, and password in a sub-configuration file.

.sendman.json contains:

{
  "protocol": "ftp",
  "host": "somehost",
  "port": 21,
  "local": "/path/to/local/dir",
  "remote": "/path/to/remote/dir",
  "parallel": 10,
  "file": "/path/to/.secretSendman.json"
}

.secretSendman.json contains:

{
  "username": "someusername",
  "password": "somepassword"
}

Alternatively, you can use rsync.

{
  "protocol": "rsync",
  "host": "somehost",
  "local": "/path/to/local/dir",
  "remote": "/path/to/remote/dir"
}

You can also use rsync to send files between local paths.

{
  "protocol": "rsync",
  "source": "/path/to/local/dir1",
  "destination": "/path/to/local/dir2"
}