Hello,

> I'm new to lftp, and would like to do the following using the fxp protocol:
> transfer files from one ftp server to another ftp server directly, 
> having the list of files to transfer stored in a txt file.

> Is there something like lftp server1.com -o serv2.com -sourcefile 
> mylist.txt ?

there is. There are two modes available in lftp: fxp and pull/push mode. It
works the following way

This will transfer site2:/to/some/directory/another_directory to
site1:/to/some/directory/another_directory :

        lftp
        slot A; open site1; cd /to/some/directory;
        slot B; open site2; cd /to/some/directory;
        mirror another_directory slot:A;
        # To copy a file and not a directory use:
        get -O slot:A some_file

If you don't want to use FXP[1] you can disable it before you run it:

        set ftp:use-fxp false

When do the example from above, lftp will pull files from one ftp server
and push it to another in real time without wasting any diskspace on the
host where lftp runs. The lowest bandwidth will 'set' the bandwidth for
the transfer. Here a little graphic to clear things up:

# # # # #                               # # # # #
# site1 #  <---------- FXP ---------->  # site2 #
# # # # #                               # # # # #
         \                             /
          \                           /
          no fxp / control connections
            \                       /
             \                     /
              \   # # # # # # #   /
               -- # lftp host # --
                  # # # # # # #

Note: If you queue files/directories up. Enter the source/destination
directories before you type in "queue mirror ..." because lftp will
remeber the local/remote directory were the job was queued. Don't try
something like queue "cd blabla; mirror ..." ... lftp will break when
you that (never tried it, but Alex said something or it was mentioned in
the manpgae, don't remeber). You also can switch between the slots using
the 'slot command'.

slot A => switches to slot A (so you can change the directory
afterwards).

And here the reference which I used over half an year because I didn't
get use of the slot concepts (now I think I understood them):

(faui03) [~] how lftp
slot A
open a_bookmark
slot B
open ftp://site
cd /path
mirror dir slot:A
get -O slot:A path/to/file

        Thomas

[1] FXP means that lftp opens a control conenction to each site, but the
files will be moved from site1 directly to site2. If you disable FXP
using set ftp:use-fxp false the file swill be transfered over the host
running lftp. You can of course limit the 'use-fxp false' thing to some
hosts using the way described in the manpage.

Reply via email to