为什么 wget -r 不能获取所有 FTP 子目录?

为什么 wget -r 不能获取所有 FTP 子目录?

当我执行命令时:

 wget -r ftp://user:[email protected]/

它缺少任何子子目录。递归 FTP 有限制吗?

答案1

你达到了多少层深度?如果您需要超过5个,则需要提供选项-l

男人wget

-r
--recursive
    Turn on recursive retrieving.    The default maximum depth is 5.

-l depth
--level=depth
    Specify recursion maximum depth level depth.
-m
--mirror 
Turn on options suitable for mirroring. 
This option turns on recursion and time-stamping, 
sets infinite recursion depth and keeps FTP directory listings. 
It is currently equivalent to ‘-r -N -l inf --no-remove-listing’.

答案2

wget的-m选项是无限递归

-m
--mirror 
Turn on options suitable for mirroring. 
   This option turns on recursion and time-stamping, 
   sets infinite recursion depth and keeps FTP directory listings. 
   It is currently equivalent to ‘-r -N -l inf --no-remove-listing’.

谢谢你的帮助。

相关内容