使用命令行从FTP上下载整个目录

<![CDATA[

wget -m ftp://xxxx/dirname –
ftp-user=user –ftp-password=password

m 参数表示镜像指定的目录 等同于 -r -N -l inf –no-remove-listing

能实现此功能的另一个办法是

wget -rtxx ftp://172.16.12.111/ppp/*

r是断点绪传,t是失败后可重新联接的xx次。

例如从ftp上直接下载整个目录到本地,我使用的完整命令是

wget -nH –cut-dirs=1 -m –ftp-user=szh –ftp-password=szhftp ftp://192.168.13.17/Server_CDROM

从ftp下载时与目标路径相关的两个参数:

-nH

--no-host-directories 

    Disable generation <wbr>of host-prefixed directories. <wbr> By default, invoking Wget <wbr>with -r 

    http://fly.srk.fer.<wbr>hr/ will create a structure <wbr>of directories beginning with 

    fly.srk.fer.hr/.  <wbr>This option disables such <wbr>behavior. 

–cut-dirs=number

Ignore number <wbr>directory components.  This <wbr>is useful for getting a fine-<wbr>grained control 

over the directory <wbr>where recursive retrieval <wbr>will be saved.

]]>