## Installation
- download the module
sshbackup.js - add it into the modules in your application directory
/your-application-directory/modules/sshbackup.jsInstall ssh2 module from npm using npm install ssh2
Paste the code bellow to some definition file.
MODULE('ssh-backup').init({
host: '1.2.3.4',
port: 22,
username: 'username',
password: 'password'
});
// or using privateKey
MODULE('ssh-backup').init({
host: '1.2.3.4',
port: 22,
username: 'username',
privateKey: require('fs').readFileSync('/path/to/the/key')
}); var source = '/local/path/to/the/file.json';
var dest = '/remote/path/to/the/file.json';
MODULE('ssh-backup').backup(source, dest, function(err){
console.log('DONE', err);
});
