我正在尝试从ftp站点下载一些数据,但是登录时遇到了问题。我知道用户名/密码是正确的,因为它在交互式使用ftp时有效。但是,当我尝试使用wget时,我得到:
Logging in as $username...
Login incorrect.
我从命令行尝试了以下命令:
wget -r -nd -A "path/to/data/*/*hdf" --ftp-user=$username --ftp-password=$password ftp:$ftpSite
wget -r -nd -A "path/to/data/*/*hdf" --user=$username --password=$password ftp:$ftpSite
wget -r -nd -A "path/to/data/*/*hdf" --ftp-user=$username --ask-password ftp:$ftpSite
wget -r -nd -A "path/to/data/*/*hdf" --user=$username --ask-password ftp:$ftpSite
我总是得到相同的“登录不正确”失败。
我在不使用变量的情况下从命令行运行。我只在这个问题中使用变量来审查敏感信息。
我会在ftp中使用mget,但我的理解是我不能使用通配符从多个子目录中获取文件。当我尝试“mget * / * hdf”时,我得到一个“没有这样的文件或目录”错误。但是我知道数据存在,因为当我进入其中一个子目录并执行“mget * hdf”时,它可以工作