SCP fails sometimes


 
Thread Tools Search this Thread
Operating Systems AIX SCP fails sometimes
# 1  
Old 06-19-2007
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  
Old 06-19-2007
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  
Old 06-19-2007
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  
Old 06-19-2007
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  
Old 06-19-2007
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  
Old 06-19-2007
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
# 7  
Old 06-20-2007
Hi guys....

iam still waiting for a reply......

Thanks
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need to know why crontab -e fails

more cron.txt 1 * * * * /u/ways.sh 2>&1 >/dev/null bash-4.1$ export EDITOR=vi bash-4.1$ crontab -e <cron.txt Vim: Warning: Input is not from a terminal Vim: Error reading input, exiting... Vim: Finished. The crontab file was not changed. bash-4.1$ echo $? 1 bash-4.1$ uname -a SunOS... (3 Replies)
Discussion started by: mohtashims
3 Replies

2. HP-UX

shl_load fails

Hi, I have written a simple program of 2 lines in C to load a library using SHL_LOAD. It fails with error "/usr/lib/hpux32/dld.so: Unable to find library 'xyz.sl'. Load failure for library , ERRNO = 2" Shlib_PATH,LD_LIBRARY_PATH,PATH,LD_PRELOAD are set correctly and library exists on the... (0 Replies)
Discussion started by: ashwinichavan
0 Replies

3. Red Hat

mkinitrd fails

hi, i´ve been the last 48 hours with this issue.... after clone another system to a new one with lvm, the last step is mkinitrd. i execute it and it finish, but some errors are sent to stderrr. /sbin/mkinitrd: line380: gawk: command not found Traceback (most recent call last) File... (0 Replies)
Discussion started by: pabloli150
0 Replies

4. Programming

realloc() fails

Not sure in which forum to post this. I'm trying here, in Programming. I'm working on a PC with Intel Duo processor & 2GB of ram. OS is Ubuntu 10.04. I'm having problems with a C++ program that makes extensive use of realloc(). It happens that as soon as the overall memory allocated(OS +... (14 Replies)
Discussion started by: mamboknave
14 Replies

5. Programming

What happens when realloc() fails?

Hi, I am seeing varying results about, when realloc() fails in reallocation. Which one is correct out of the below? a) realloc() maintains the original pointer (i.e) the original pointer is left unaltered/untouched but relloc() returns the NULL value. b) original buffer pointer is lost... (3 Replies)
Discussion started by: royalibrahim
3 Replies

6. Shell Programming and Scripting

until loop fails.

i have a script like below, i am trying to print "...." until a background process that was executed before is running,, the below does work and teh loop keeps on printing "..", can someone help where i am wrong. /tmp/test/abc.sh & until do echo "..\c" done abc.sh is the scipt... (8 Replies)
Discussion started by: yesmani
8 Replies

7. UNIX for Dummies Questions & Answers

scp from aix to windows (cygwin) fails

Hi... my problem is that I want to copy one html-file to my windows-box webserver using scp. so far no problem but the destination is in /cygdrive/c/program files/dest and as we all know unix doesnt like spaces in paths. scp html.file user@windowsbox:/cygdrive/c/program... (5 Replies)
Discussion started by: cypher82
5 Replies

8. UNIX for Advanced & Expert Users

make fails...

Hi When im trying to do make --version and make --help in HP-UX it throws error Make: Unknown flag argument -. Stop. a soft link is present in this directory /usr/bin/make and hard link is in /usr/ccs/bin/make what could be the reason can any1 ..please tell me how to solve this... (1 Reply)
Discussion started by: vasanthan
1 Replies

9. UNIX for Dummies Questions & Answers

pkg_add fails

Hi, I have created a package on a 64 bit FreeBSD machine. when i install this (on another 64 bit FreeBSD machine )i get the following error : tar: Skipping pathname containing .. pkg_add: tar extract of /home/vcr/testpackage.tgz failed! pkg_add: unable to extract '/home/vcr/testpackage.tgz'!... (0 Replies)
Discussion started by: HIMANI
0 Replies

10. UNIX for Advanced & Expert Users

at command fails

hi, all the user on my machine can't launch at job anymore. they all got the message "error in message send" each time they launch something using the at command. i tried to empty the job queue but the error message is still there. What can I do ? Thanks (1 Reply)
Discussion started by: a329743
1 Replies
Login or Register to Ask a Question