The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Operating Systems > AIX
.
google unix.com



AIX AIX is IBM's industry-leading UNIX operating system that meets the demands of applications that businesses rely upon in today's marketplace.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Put fails during FTP prakash.kudreka UNIX for Advanced & Expert Users 2 11-15-2007 05:14 AM
pkg_add fails HIMANI UNIX for Dummies Questions & Answers 0 09-04-2007 05:33 AM
Script fails JStone Shell Programming and Scripting 8 08-10-2006 12:00 AM
Need to know why Perl fails. whatsup Shell Programming and Scripting 0 07-12-2006 10:43 PM
stat() fails!!! what can i do? solvman High Level Programming 3 02-06-2002 05:17 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 06-19-2007
vipinc vipinc is offline
Registered User
  
 

Join Date: Jun 2007
Posts: 7
SCP fails sometimes

Hi,

I got a unix script which copies a file from my AIX machine to a file server using SCP command. I am calling this script 3 times in my process after a time interval say 5mins. My issue here is like most of the time its not sending the file at the first time run while other 2 will work fine. I have found that the files are getting created, only issue is with the SCP.

I tried scp -v (verbose mode) and redirected to a log file. But its not writing anything to the logfile if it doesnt copy the file.

Can anyone put some light on this issue.

Thanks
Vipin C
  #2 (permalink)  
Old 06-19-2007
porter porter is offline Forum Advisor  
Registered User
  
 

Join Date: Jan 2007
Posts: 2,965
Are the two machines on the same subnet or connected via routers?

Try doing a "ssh remotehost uname" or similar prior to the first "scp" just to confirm that the ARP tables are up to date.
  #3 (permalink)  
Old 06-19-2007
vipinc vipinc is offline
Registered User
  
 

Join Date: Jun 2007
Posts: 7
Hi Porter,

Can you explain a little bit more. Because I am completely new to this networking scenarios evenif i hav worked with some small unix scripts. And what is this 'uname' stands for?

thanks in advance,
Vipin C
  #4 (permalink)  
Old 06-19-2007
porter porter is offline Forum Advisor  
Registered User
  
 

Join Date: Jan 2007
Posts: 2,965
The 'uname' thing is purely something to run on the remote host so that you know you were able to talk to it. It could be *any* simple command that takes no stdin and executes quickly.

The problem I am trying to solve is you say that the 2nd scp works but not the first, this may be because the client has not managed to establish a network path to the remote server, hence running a command prior to confirm we do have connectivity with the remote host prior to doing the "scp" transfers.
  #5 (permalink)  
Old 06-19-2007
encrypted's Avatar
encrypted encrypted is offline Forum Advisor  
Registered User
  
 

Join Date: Feb 2004
Location: Oslo, Norway
Posts: 219
As porter suggested, first get the connectivity through. Once that is done and still it does not work try to see if the ssh/scp processes get hung up somehow(I have seen that happen on Solaris). Check for the ssh version on your box and probably a patch for that version might fix the problem.
Also, first try to scp/ssh to that machine from the command line. Btw, is this a password based or key based authentication? Also, what "process" are you using to scp/ssh to the other machine?
  #6 (permalink)  
Old 06-19-2007
vipinc vipinc is offline
Registered User
  
 

Join Date: Jun 2007
Posts: 7
Yes. It is a key based authentication. I can do the scp within a particular user login. So I guess, the public key for the user is saved in the secure file server to which Iam sending the file.
let me tell the actual scenario. I have developed the scripts from a test server and its working finewhen I executed there. Then I moved the scripts with my process to another server,scheduled to execute in a daily manner. When its executing automatically,this problem arises. But iam not quite sure its a connectivity issue, bcoz sometimes the first file copy correctly and miss the second one or third one.
This is the command I used for the same
scp_cmd="/usr/local/bin/scp -v $Target_file remoteservername:$Copy_directory";

Thanks
Vipin C
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 01:09 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0