Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Net::SCP::Expect appears to ignore Timeout value

by blue_cowdawg (Monsignor)
on Mar 21, 2013 at 15:03 UTC ( #1024768=perlquestion: print w/ replies, xml ) Need Help??
blue_cowdawg has asked for the wisdom of the Perl Monks concerning the following question:

Check out this sniglet of code:

foreach my $host (@hosts) { my $scpe = Net::SCP::Expect->new( host => $host, # user => $user, # password => $password, compress => 1, auto_yes => 1, no_check => 1, debug=>1, timeout => 120 ); $scpe->login($user,$password); printf "Copying files to %s:\n", $host; foreach my $file (@files) { printf "\t%s....", $file; my $remote=sprintf("%s\@%s:/tmp",$user,$host); printf "%s..",$remote; $scpe->scp( $file, $remote); printf "\r"; } }
I realize that debug is a bogus parameter but the code is failing with a timeout at the scp line after about 10 seconds. (or less)

Is there a way around this issue? Should I abandon Net::SCP::Expect? Any thoughts?


Peter L. Berghold -- Unix Professional
Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg

Comment on Net::SCP::Expect appears to ignore Timeout value
Select or Download Code
Re: Net::SCP::Expect appears to ignore Timeout value
by kschwab (Priest) on Mar 21, 2013 at 15:32 UTC
    Try setting timeout_auto and timeout_err as well. Both are used within the $scpe->scp method.

      symptoms unchanged.


      Peter L. Berghold -- Unix Professional
      Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg
        Your code worked fine on my system. What's the error when it bails? Maybe you could try Net::OpenSSH and it's scp_put method?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1024768]
Front-paged by Arunbear
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (8)
As of 2014-12-25 13:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (160 votes), past polls