Tartalomjegyzék

< NodeJS

remote-sync

A remote-sync

A remote-sync az lftp előtét programja.

Webhely

Szükséges

npm install --save-dev remote-sync

Kliens

Tegyük fel:

remote-sync.js
const RemoteSync = require('remote-sync');
const upload = 'mirror -R -c --overwrite public htdocs'
const config = {
    operations : [
        {
            operation : 'feltöltés',
            command : upload
        }
    ],
    user : 'valaki',
    pw : 'titok',
    host : 'valahol.tld',
    lftp_settings : {
        'ftp:ssl-force': 'true',
        'ftp:ssl-protect-data':'true',
        'ssl:verify-certificate':'true',        
    }
};
const client = new RemoteSync(config);
client.perform();

Futtatás:

node remote-sync.js

Ha nem ismert tanúsítványt automatikusan szeretnénk elfogadni:

ssl:verify-certificate':'false'

Ami nem ajánlott „kategória”.