2016-12-28 21 views
1

我目前正在尝试更新一些工作中的代码。我以前使用最新版本的Python创建了一个脚本,它在NCBI的FTP网页上记录用户路径选择(ftp://ftp.ncbi.nlm.nih.gov/)。日志被用来更新我的文件系统与更新的文件(NCBI每周更新他们的文件,我相信)。我基本上重新创建了轮子。我现在想使用rsync,但我似乎无法得到我想要的东西......为什么在连接到NCBI的FTP服务器主页时rsync无法工作?

rsync -vah --include "\*/" --exclude "\*" rsync://ftp.ncbi.nlm.nih.gov/* 

上述脚本应该去NCBI的网站,并开始下载目录。相反,它会在NCBI主目录中打印文件夹列表,然后终止而不复制任何内容。

这里是输出的样子:

**Warning Notice!** 

**You are accessing a U.S. Government information system which includes this 
computer, network, and all attached devices. This system is for 
Government-authorized use only. Unauthorized use of this system may result in 
disciplinary action and civil and criminal penalties. System users have no 
expectation of privacy regarding any communications or data processed by this 
system. At any time, the government may monitor, record, or seize any 
communication or data transiting or stored on this information system.** 

**-------------------------------------------------------------------------------** 

**Welcome to the NCBI rsync server.** 

- 1000genomes 
- bigwig 
- bioproject 
- biosample 
- blast 
- cgap 
- cn3d 
- dbgap 
- entrez 
- epigenomics 
- fa2htgs 
- genbank 
- gene 
- genomes 
- hapmap 
- mmdb 
- ncbi-asn1 
- pathogen 
- pubchem 
- pubmed 
- pub 
- refseq 
- repository 
- SampleData 
- sequin 
- sky-cgh 
- snp 
- sra 
- tech-reports 
- toolbox 
- tpa 
- tracedb 
- variation 

[[email protected] ~/bin $] 

每当我使用

rsync://ftp.ncbi.nlm.nih.gov/destination 

(基本上,如果我包括NCBI的FTP网页内部的任何目录)一切似乎很好地工作。

我应该在这里做什么?什么是问题/解决方案?

回答

0

rsync基本表现为cp。所以通用语法是:

rsync source destination 

-r可以用于递归。所以你的情况可能是:

rsync -r rsync://ftp.ncbi.nlm.nih.gov/ ./ 

PS:请格式化代码与四个空格,而不是明星。

相关问题