Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^2: My Perl/Expect script aborts when sftp connection stalls at remote destination

by Anonymous Monk
on Feb 24, 2010 at 19:52 UTC ( [id://825159]=note: print w/replies, xml ) Need Help??


in reply to Re: My Perl/Expect script aborts when sftp connection stalls at remote destination
in thread My Perl/Expect script aborts when sftp connection stalls at remote destination

First, zow, thanks for the quick reply. When connected manually I see the 1-line status info line progressing through from 0% to 100%, with the sporadic message of stalled. But it finishes. For the script's run it seems to just cut off, maybe at the first stall, as if I did a kind of "kill" command from the UNIX command line. As to switching to Net::SFTP, that'd be a tough switch since our script is already in production and we don't have Net::SFTP in our shop at this point. I know it sounds dumb to have a frail app in production. Most future files are expected to be small enough that the problem vanishes, and I can manually get the rare files that are too big. ALSO, I'll see if a late night run of the script, when the traffic should be much lower, avoids the problem.
  • Comment on Re^2: My Perl/Expect script aborts when sftp connection stalls at remote destination

Replies are listed 'Best First'.
Re^3: My Perl/Expect script aborts when sftp connection stalls at remote destination
by bobthebaritone (Sexton) on Feb 25, 2010 at 10:17 UTC
    Is there any reason not to use the complete expect to run this? The PERL module is not a fully implementation of expect as far as I know. I recall from Don Libes book ( the writer of expect) that there is excellent handling of exceptions you speak of in native expect. I'd be interested to give this some more thought as I use native expect in a PERL shop. I have been thinking of using the module, but found that Expect is a complete language!
Re^3: My Perl/Expect script aborts when sftp connection stalls at remote destination
by salva (Canon) on Feb 25, 2010 at 15:09 UTC
    Really, forget about solving your problem with Expect and use one of the Perl SFTP modules. It doesn't matter how hard it is to get it or a new version of the script in production. Properly done, your file transfers will be reliable and you will not have to worry about them anymore. It will pay back!

    My own recommendation is to go with Net::SFTP::Foreign, but I am the author, not completely unbiased!

Re^3: My Perl/Expect script aborts when sftp connection stalls at remote destination
by zow (Sexton) on Feb 25, 2010 at 19:26 UTC

    One other thing that I noticed is that in your while loop over your commands you are calling the expect method with the 600 sec timeout before the send method. Perhaps it is still using a default timeout?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://825159]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (8)
As of 2024-04-19 09:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found