ssh2-robot
v0.0.1
Published
exec command at remote host
Downloads
3
Readme
ssh2-robot: 在远程服务器上执行程序
通过ssh,执行远程服务器上的程序。
Installing
npm install ssh2-robot
Using
var config = require('./config.js');
var schedule = require('./schedule.js');
schedule(config['mit'], {
ready: {
op: 'exec',
cmd: 'ls',
cb: function(code, stdout, stderr, signal) {
console.log('ls', code);
process.stdout.write(stdout);
process.stderr.write(stderr);
return 'ls -l';
}
},
'ls -l': {
op: 'exec',
cmd: 'ls -l',
cb: function(code, stdout, stderr, signal) {
console.log('ls -l', code);
process.stdout.write(stdout);
process.stderr.write(stderr);
return 'ls -al';
}
},
'ls -al': {
op: 'exec',
cmd: 'ls -al',
cb: function(code, stdout, stderr, signal) {
console.log('ls -al', code);
process.stdout.write(stdout);
process.stderr.write(stderr);
return 'end';
}
}
});
Dependences
ssh2