LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   scp is looping without being in a loop (https://www.linuxquestions.org/questions/linux-software-2/scp-is-looping-without-being-in-a-loop-814953/)

blainemiller 06-18-2010 10:53 AM

scp is looping without being in a loop
 
Hello,

I'm trying to execute some fairly simple code to transfer some files from one server to another.

$ cat xfer_directory.sh

#!/bin/bash
cd /cygdrive/g/directory/usr
rm -Rf /cygdrive/g/directory/usr/*
cd /cygdrive/g/directory/var
rm -Rf /cygdrive/g/directory/var/*
# scp -r -C -c blowfish root@10.0.0.9:/var/ .
cd /cygdrive/g/directory/usr
scp -r -C -c blowfish root@10.0.0.9:/usr/ .

As you can see there are no obvious loops. Yet the transfer never gets to the second scp statement. It hits a particular subdirectory of /usr and continues to transfer that subdirectory and its' contents until I break out of the seemingly looped condition.

Neither of the primary directories nor the subdirectories are symbolic links. I'm at a loss for why this simple script keeps looping without any looping statements in the script.

I'm sure it's something simple I'm just not able to see. Any help/comments would be gratefully appreciated.

Thanks!

Blaine

blainemiller 06-18-2010 12:18 PM

I think I've found the source of the problem. Apparently there ARE symlinks along the lower subdirectory path's. I understand that scp will follow symlinks blindly and in this case into a loop.

So my question is how do I recursively tranfer large directories of files without traversing symlinks? I've seen two altrernative means, one is to tar the files and then untar them at the other end. The other has to do with rsync, which I'm not familiar with.

I have yet to find a solution that uses scp that skips symlinks. Any ideas? Thoughts?

Again, thanks for looking and your time & comments are appreciated.

Blaine


All times are GMT -5. The time now is 11:59 PM.