freeop has asked for the wisdom of the Perl Monks concerning the following question:
HI,
My client scrip connect to remote ssh server, and execute perl scrip.
Remote STDOUT and remote STDERR redirect to local file.
****bufile.plif ( $sshconn = Net::SSH::Perl->new("localhost", %params) ) { $sshconn->login('op'); $sshconn->register_handler("stdout", sub { my($outchannel, $outbuffer) = @_; print(FOUT $sshconn->type);}); $sshconn->register_handler("stderr", sub { my($errchannel, $errbuffer) = @_; print(FERR $errbuffer->bytes);}); ($ssherr, $ssherr, $sshexit) = $sshconn->cmd("/tmp/bufile.pl"); $sshconn->cmd("exit"); }
after (1 hour) server sent this message:print(STDERR "TAR START...\n"); system("tar -cmvzf /tmp/large.tgz /tmp/largedir"); print(STDERR "TAR END.\n");
janitored by ybiC: Balanced <code> tags around codeblock, and balanced <tt> tags around error and log text
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: net::ssh:perl - sshd: debug1: need rekeying
by wazoox (Prior) on Apr 27, 2005 at 16:22 UTC | |
by Anonymous Monk on May 09, 2005 at 12:47 UTC | |
by wazoox (Prior) on May 09, 2005 at 14:29 UTC | |
by Anonymous Monk on May 09, 2005 at 16:00 UTC | |
by wazoox (Prior) on May 09, 2005 at 16:29 UTC | |
| |
by freeop (Initiate) on May 09, 2005 at 16:14 UTC |