mirror-tutorial/en mirror-tutorial-en.xml,1.2,1.3

Hugo Cisneiros (eitch) fedora-docs-commits at redhat.com
Mon Feb 6 20:29:55 UTC 2006


Author: eitch

Update of /cvs/docs/mirror-tutorial/en
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv29832

Modified Files:
	mirror-tutorial-en.xml 
Log Message:
added lftp command to the http or ftp mirroring method (BZ #178790)


Index: mirror-tutorial-en.xml
===================================================================
RCS file: /cvs/docs/mirror-tutorial/en/mirror-tutorial-en.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- mirror-tutorial-en.xml	4 Feb 2006 04:51:01 -0000	1.2
+++ mirror-tutorial-en.xml	6 Feb 2006 20:29:48 -0000	1.3
@@ -639,8 +639,9 @@
       <section id="sn-http-and-ftp-download">
 	<title>Download Using HTTP or FTP</title>
 	<para>
-	  To download via HTTP or FTP, use the <command>wget</command>
-	  command.  <command>wget</command> recurses subdirectories
+	  To download via HTTP or FTP, use either the
+	  <command>wget</command> or the <command>lftp</command>
+	  command. <command>wget</command> recurses subdirectories
 	  automatically and pulls down entire trees of data with a
 	  single command. If you are not careful, however, it is
 	  possible to pull down much more data than you intended. The
@@ -698,6 +699,115 @@
 	  options. See the <command>wget</command> man pages for more
 	  information.
 	</para>
+
+	<para>
+	  The <command>lftp</command> command works like the
+	  <command>wget</command> command, mirroring the content of a
+	  HTTP or FTP server. But there are problems with updating the
+	  mirror with <command>wget</command>, like not deleting
+	  old files locally. This is very important when creating an
+	  updates repository mirror, where new files are created
+	  frequently and old files are automatically removed from the
+	  upstream mirrors.
+	</para>
+
+	<para>
+	  With <command>lftp</command> you can synchronize files and
+	  directories from a remote host just like
+	  <command>rsync</command>, but using HTTP or FTP protocols. For
+	  example: doing the above method used by wget to mirror the
+	  entire current Fedora Core distribution:
+	</para>
+
+<screen>
+<userinput>cd /var/www/mirror
+lftp -e "open http://mirror.example.com/pub/mirror/linux/core/&FCVER;/i386/ && \
+mirror --delete --verbose && \
+quit"</userinput>
+</screen>
+
+	<para>
+	  The <command>-e</command> parameter tells
+	  <command>lftp</command> to execute given commands. Doing
+	  this, you can execute many actions from a single command.
+	  Commands are separated with &&, so note the commands
+	  above:
+	</para>
+	  
+	<itemizedlist>
+	  <listitem>
+	    <para>
+	      <command>open</command> connects to the site and changes
+	      the directory automatically.
+	    </para>
+	  </listitem>
+	  <listitem>
+	    <para>
+	      <command>mirror --delete --verbose</command> tells
+	      <command>lftp</command> to fetch all files and/or
+	      directories recursively in the current directory (opened
+	      by the <command>open</command> command). The
+	      <command>--delete</command> parameter excludes all local
+	      files that are not in the remote directory, and the
+	      <command>--verbose</command> parameter prints some
+	      information in the screen and is optional.
+	    </para>
+	  </listitem>
+	  <listitem>
+	    <para>
+	      <command>quit</command> is last executed and
+	      <command>lftp</command> exits finishing the job.
+	    </para>
+	  </listitem>
+	</itemizedlist>
+
+	<para>
+	  <command>lftp</command> will mantain an exact copy of the
+	  directory for you: only new files will be downloaded and old
+	  files will be deleted.
+	</para>
+
+	<para>
+	  As with <command>wget</command>, it is possible that you may
+	  download some unwanted files in directories.
+	  <command>lftp</command> supports regular expressions when
+	  excluding files within a <command>mirror</command> command.
+	  In another example, the command below shows how to mirror an
+	  current Fedora Core distribution updates repository,
+	  excluding the <filename>debug</filename> and
+	  <filename>repodata</filename> directories:
+	</para>
+
+<screen>
+<userinput>cd /var/www/mirror
+lftp -e "set mirror:exclude-regex 'debug\/|repodata\/' && \
+open http://mirror.example.com/pub/mirror/linux/core/updates/&FCVER;/i386/ && \
+mirror --delete --verbose && \
+quit"</userinput>
+</screen>
+
+	<para>There are many usages for the <command>lftp</command>
+	command. Consult the <command>lftp</command> man pages for more
+	details.</para>
+
+	<tip>
+	  <title>Using Proxy for HTTP or FTP retrieval</title>
+	  <para>
+	    Sometimes when behind a proxy or firewall, you may need to
+	    do mirroring throught a http proxy. This can be accomplished
+	    exporting the environment variables
+	    <command>http_proxy</command> and
+	    <command>ftp_proxy</command> before running the
+	    <command>wget</command> or <command>lftp</command> commands,
+	    like this:
+	  </para>
+
+<screen>
+<userinput>export http_proxy=http://<replaceable>username</replaceable>:<replaceable>password</replaceable>@<replaceable>host</replaceable>:<replaceable>port</replaceable>
+export ftp_proxy=http://<replaceable>username</replaceable>:<replaceable>password</replaceable>@<replaceable>host</replaceable>:<replaceable>port</replaceable></userinput>
+</screen>
+
+	</tip>
       </section>
 
       <section id="sn-rsync">




More information about the Fedora-docs-commits mailing list