LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-22-2013, 04:08 PM   #1
EnderX
Member
 
Registered: Nov 2006
Posts: 66

Rep: Reputation: 15
Shell scp works perfectly, Net::SCP::Expect calls timing out - reasons?


First, I believe this is the appropriate area to post this question, but I'm not sure - if it belongs somewhere else, I would appreciate having someone move it to where it needs to be.

I'm working on setting up a RHEL 6.4 virtual machine, in this particular case attempting to run a script designed to copy database log files for use with a replication setup. This particular version of the script is trying to copy the files from one location on the machine, to another location on the same machine. Except for some of the IP configuration details, this script is identical to the version we've had running on remote servers getting the files from this machine's predecessor in the past.

On the previous machines I've run this on (a SuSE 11.3 and a SuSE 9.3 box), I've been able to get this script to run without any problems. On this new machine, the script invariably fails out with the following error message (IP blotted, otherwise exact):

Code:
Uncaught exception from user code:
        scp timed out while trying to connect to ###.###.###.### at ./sl-logshipn-r line 203
 at /usr/local/share/perl5/Net/SCP/Expect.pm line 228
        Net::SCP::Expect::scp('Net::SCP::Expect=HASH(0x6e5b98)', '###.###.###.###:/var/log/slony/logship/arc/slony1_log-attestr2-20...', '/var/log/slony//logship2/arc/slony1_log-attestr2-20130422_114...') called at ./sl-logshipn-r line 203
The line in the code which the error is triggering on is:
Code:
$scpe->scp("$host:$lsnLOGDIR/arc/$zip_nm","$lship_arcdir/$zip_nm");
I can call the files across manually via the scp command from the shell prompt, using the same username; the system does not appear to require a password when I do this, and the copy appears to occur immediately.

What specifically determines the where/how of how Net::SCP::Expect tries to transfer an scp'd file? Obviously, I messing up in something there, but I'm not sure where to begin trying to track the error down. Any advice on a good starting point would be greatly appreciated.
 
Old 04-27-2013, 01:35 AM   #2
Andy Alt
Member
 
Registered: Jun 2004
Location: Minnesota, USA
Distribution: Slackware64-stable, Manjaro, Debian64 stable
Posts: 528

Rep: Reputation: 167Reputation: 167
Quote:
$scpe->scp("$host:$lsnLOGDIR/arc/$zip_nm","$lship_arcdir/$zip_nm");
Do you need to add the host variable before $lship?

"$host:lship_arcdir/$zip_nm"

Do you have the same problem if you use rsync?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with Net::SCP::Expect in pell script grzeslaw Programming 3 03-11-2013 09:02 AM
[SOLVED] SCP with wildcard in Expect s7upify Linux - General 5 07-18-2011 12:12 PM
scp file to multiple hosts with expect loadedmind Programming 4 04-11-2011 09:28 PM
Expect script, scp and find command unihiekka Programming 1 10-17-2008 03:11 PM
How to use EXPECT command to scp or ssh? thefountainhead100 Linux - Software 6 03-28-2008 06:41 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration