2016-12-28 1 views
1

현재 직장에서 일부 코드를 업데이트하려고합니다. 이전에 NCBI의 FTP 웹 사이트 (ftp://ftp.ncbi.nlm.nih.gov/)에서 사용자 경로 선택 항목을 기록하는 Python의 최신 버전이 포함 된 스크립트를 만들었습니다. 로그는 내 파일 시스템을 업데이트 된 파일로 업데이트하는 데 사용되었습니다 (NCBI는 매주 파일을 업데이트합니다). 나는 기본적으로 바퀴를 재현했다. 지금은 rsync를 사용하려면,하지만 난NCBI의 FTP 서버 홈페이지에 연결할 때 rsync가 작동하지 않는 이유는 무엇입니까?

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

위의 스크립트는 NCBI의 웹 사이트로 이동 및 디렉토리를 다운로드를 시작합니다 ... 내가 원하는 것을 얻을 수없는 것. 대신 쉘에 NCBI 홈 디렉토리의 폴더 목록을 인쇄 한 다음 아무 것도 복사하지 않고 종료합니다. 나는 모든 것이 잘 작동하는 것 같다 (나는 NCBI의 FTP 홈페이지의 내부에 디렉토리를 포함 기본적으로 경우)

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

를 사용할 때마다

**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 $] 

: 여기

출력이 모습입니다.

여기서 어떻게해야합니까? 문제/해결책은 무엇입니까?

답변

0

rsync은 기본적으로 cp처럼 동작합니다. 그래서 일반 구문은 다음과 같습니다

rsync source destination 

-r는 재귀 사용할 수 있습니다. 따라서 귀하의 경우가 될 수있다 :

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

PS : 네 개의 공간이 아닌 스타와 코드를 포맷하십시오.

관련 문제