Solved

Using LFTP to mirroe 2 remote directories

Posted on 2009-07-08
13
1,592 Views
Last Modified: 2013-12-02
I am trying to sync two remote file structures using lftp and fxp protocals.  Can some supply the correct syntax or a script to do the following
ftp site a: foo.bar.com  user id fred password flintstone directory mydocs
ftp stie b: just.me.com user id bill password aredue directory htdocs
0
Comment
Question by:ajohnpeters
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 6
13 Comments
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 250 total points
ID: 24813610
Something like the following should work -

set ftp:use-fxp true
open foo.bar.com
user fred flintstone
mirror /mydocs
[i]ftp://bill:aredue@just.me.com/htdocs[/i]

If you put the above into a controlfile, let's say a2b.ftprc , you can use
lftp -f a2b.ftprc
Good luck!
wmp

0
 

Author Comment

by:ajohnpeters
ID: 24814521
How does lftp know that mydocs is on foo.bat.com and not the local machine?
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 24814613
via open ...
0
Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

 

Author Comment

by:ajohnpeters
ID: 24818476
IT appears to load to my local machine not to the remote machine.  I verified that fxp was available on both machines.

Connected to remote 1---did mirror to ftp on remote 2.  All the files showed up on my local and not on remote 2.  Does lftp do this in a 2 step process remote1-->local-->remote2

I do not have enough disk space on my local for this/
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 24818612
Strange ...
No, fxp is not a two stage method.
Please help me understand -
All the files showed up on my local ... <
Does this mean that the files got actually fetched from remote 1? If yes, the open has succeeded and since you specified the target as an URL, there should be no reason to store th files locally. At which location did the files show up on your local machine?
We could try with two URLs, although my version worked for me (I can't test at the moment, we don't use lftp anymore).
mirror ftp://fred:flintstone@foo.bar/mydocs ftp://bill:aredue@just.me.com/htdocs
wmp
 
 
0
 

Author Comment

by:ajohnpeters
ID: 24818661
THe files can to a directory named ftp:/fred:flintstorne@foo.bar/mydocs
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 24818685
OK,
if there is REALLY only one slash following ftp:  we've foud the culprit ...
0
 

Author Comment

by:ajohnpeters
ID: 24818888
here is my current command

set ftp:use-fxp true
mirror --only-newer --verbose -P ftp://ntsxxxxxx:yyyyyyyyyy@ymy.com/htdocs ftp://xxxxx+otg-dss.com:yyyyyyyy@your.com/

I need to go home for the night before my wife kills me.
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 24818939
OK, apart from the missing target directory - that MUST work!

Else your servers (one or both) aren't really FXP capable!


0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 24818942
P.S. Good night!
0
 

Author Comment

by:ajohnpeters
ID: 24824764
When I use this syntax I get not connected
set ftp:use-fxp true
mirror --only-newer --verbose -P ftp://ntsxxxxxx:yyyyyyyyyy@ymy.com/htdocs ftp://xxxxx+otg-dss.com:yyyyyyyy@your.com/

this correct?  I connected to both sites with the connect command and user command
set ftp:use-fxp true
mirror ftp://SiteAUsername:SiteAPassword@SiteADomainName  ftp://SiteBUsername:SiteBPassword@SiteBDomainName

The above is on one line.
0
 

Author Comment

by:ajohnpeters
ID: 24825705
I just talked to Network Solutions and they do not offer fxp on their servers.l   It At least according the tech I called.  Can anyone verify that?  What does lftp do when you try fxp on a non-supportted server.

wilmilkproc,  I will award the points soon.

I used fetch on a Mac, and it seemed to work.  Do you think it was doing a download upload scenario?
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 24838079
Hi,
afaik lftp would fallback to plain copy (via client) if FXP transfer cannot be initiated.
wmp
 
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever had a hard drive that you can't boot into, but need to change the registry? Here is the solution! This article guides you through accessing and editing a registry of a non-primary drive. To read registry information on a non-prim…
Preface There are many applications where some computing systems need have their system clocks running synchronized within a small margin and eventually need to be in sync with the global time. There are different solutions for this, i.e. the W3…
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question