일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- IT 키워드
- Linux
- LDAP
- 작성중
- 안드로이드
- conemu
- Android
- KOSPI
- uml example
- 도서
- Eclipse
- Algorithm
- Audacity
- java
- Qmail
- 알고리즘
- 태터수정
- adb
- UX
- 우분투
- ubuntu
- 기술사
- eclipse35
- unix
- IPTV
- 주식
- 코스피
- 공매도
- 보안
Archives
- Today
- Total
Do diffence
[Unix] 쉘 스크립트로 ftp 로 다운로드는? 본문
원문: http://www.thegeekstuff.com/2010/12/how-do-i-ftp-and-download-files-from-a-unix-shell-script/
HERE document 로 작성
ftp scripting
HERE document 로 작성
$ ftp -in URL << SCRIPTEND
user USERNAME PASSWORD
binary
cd PATH
mget PATH
SCRIPTEND
- ftp : ftp 명령
- -i : 입력 프롬프트 사용 안함
- -n : 자동 로그인 사용 안함
- user USERNAME PASSWORD :
- binary : binary모드로 사용
- cd PATH : 원격 디렉토리로 이동
- mget PATH : PATH의 다중 파일 가져오기
- SCRIPTEND : HERE document의 시작/끝 태그
- HERE docs are used to provide input to commands, refer Here document to know more about it.
ftp scripting
$ cat download.sh
ftp -in mirrors.issp.co.th << SCRIPTEND
user anonymous test@test.com
binary
cd cpan/authors/id/P/PM/PMQS/
mget Compress-Raw-Bzip2-2.027.tar.gz
SCRIPTEND
$ sh download.sh
$ ls
download.sh
Compress-Raw-Bzip2-2.027.tar.gz
더 많은 ftp, sftp 정보: FTP and SFTP Beginners Guide with 10 Examples