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

Net::SCP::Expect wierdness

by blue_cowdawg (Prior)
on Aug 29, 2012 at 20:43 UTC ( #990564=perlquestion: print w/ replies, xml ) Need Help??
blue_cowdawg has asked for the wisdom of the Perl Monks concerning the following question:

OK.. so I'm using Net::SCP::Expect to automate some of my work. Check this bit of code:

my $scpe= new Net::SCP::Expect ( host => 'myhost', user => 'myaccount', password => 'secret', recursive => 1, preserve => 1, compress => 1, no_check => 1, timeout => 60, ); $scpe -> scp ("/home/path/whatever", "myaccount@myhost:/tmp/" );

I've put as much of the code as I dare but that is the essence and I bomb out with

scp timed out while trying to connect to myhost at script  line 122

I add a single line in the "new" call:

verbose => 1
and the darn thing works. I hate to think I have to deal with the ugly output verbose mode gives, but it does make the script work.

Thoughts anybody?


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

Comment on Net::SCP::Expect wierdness
Select or Download Code
Re: Net::SCP::Expect wierdness
by salva (Monsignor) on Aug 29, 2012 at 20:56 UTC
    Maybe the internal timer used by Net::SCP::Expect is reset every time something arrives through the tty. Have you tried increasing the timeout value?

    Alternatively, try using Net::SSH2 or transferring the file via SFTP with Net::SFTP::Foreign.

          Maybe the internal timer used by Net::SCP::Expect is reset every time something arrives through the tty. Have you tried increasing the timeout value?

      Yes I did to ridiculous values. 900 seconds? really? Still didn't work for me.

      <ul
        transferring the file via SFTP with Net::SFTP::Foreign.

    Tried that too and it did not work for all the hosts I have to do transfers to.

    This problem is driving me nuts... and I'm already close enough to walk.


    Peter L. Berghold -- Unix Professional
    Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg
        Are you able to transfer the files using scp from the command line with the -q flag set?

        Have you tried upgrading your client machine to the latest version of OpenSSH?

        What are exactly the kind of problems you see when using SFTP? Is it disabled in some host?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (22)
As of 2014-07-29 15:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (219 votes), past polls