LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 06-18-2010, 10:53 AM   #1
blainemiller
Member
 
Registered: Dec 2003
Posts: 78

Rep: Reputation: 1
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
 
Old 06-18-2010, 12:18 PM   #2
blainemiller
Member
 
Registered: Dec 2003
Posts: 78

Original Poster
Rep: Reputation: 1
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
 
  


Reply

Tags
loop, scp


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
how to loop over text file lines within bash script for loop? johnpaulodonnell Linux - Newbie 8 04-05-2011 09:18 AM
scp does not work and gives the following error message: scp: FATAL: Executing ssh1 i akay Linux - Networking 16 09-28-2008 11:41 PM
bash loop within a loop for mysql ops br8kwall Programming 10 04-30-2008 03:50 AM
for loop only works properly on first loop symo0009 Programming 1 12-25-2005 05:17 PM
while loop not looping as intended Tarts Programming 7 11-28-2003 02:50 AM


All times are GMT -5. The time now is 10:25 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration