Total.js – New module for Total.js: SSH backup

 

Total.js has published next very interesting and useful module. According to me it is this is one another module worthy of attention paid to after the scheduler module. This is package for backing up files to remote server over sftp (ssh).   Benefits exceed expectations. Modul copes with the different burden on the network and with different sizes of files – encourage you to individual a test.

Installation

  • download the module sshbackup.js
  • add it into the modules in your application directory
/your-application-directory/modules/sshbackup.js

Install ssh2 module from npm using npm install ssh2

Initialization

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')
    });

Usage

    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);
    });

 

source: https://github.com/totaljs/modules/blob/master/Miscellaneous/sshbackup/readme.md

November 25th, 2016

  • Thank you so much for giving everyone remarkably marvellous chance to read critical reviews from here. It is often very cool plus stuffed with a lot of fun for me and my office co-workers to visit your blog really three times weekly to learn the new tips you will have. Not to mention, I’m always pleased with all the sensational opinions served by you. Some 1 areas in this posting are really the most suitable we have all had..

  • Aw, this was a very nice post. In concept I want to put in writing like this additionally ?taking time and precise effort to make a very good article?but what can I say?I procrastinate alot and in no way appear to get something done..