Solved

Using LFTP to mirroe 2 remote directories

Posted on 2009-07-08
13
1,466 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
  • 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
 

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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

If, like me, you have a lot of Dell servers in the estate you manage this article should save you a little time. When attempting to login to iDrac on any server I would be presented with two errors. The first reads "Do you want to run this applicati…
Citrix XenApp, Internet Explorer 11 set to Enterprise Mode and using central hosted sites.xml file.
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

757 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now