로그인
Sign in
1.    다음을 edit 합니다.
vi $HOME/.netrc
machine hp001 login testuser password test01.
(NOTE: 만약 password에 빈칸이 있으면, double quotes표시를 합니다)


2.    다음을 실행합니다.
chmod 600 $HOME/.netrc


3.    autologin test 를 합니다.
ftp hp001

Connected to hp001
220 hp001 FTP server (Version 1.7.112.3 Thu Feb 22 22:57:17 GMT 1996)
ready.
331 Password required for testuser.
230 User testuser logged in.

Remote system type is UNIX.
Use binary mode to transfer files.
ftp>

4.    아래의 script 는 file 을 자동으로 전송합니다.: 그리고 이 script 는 at이나 cron 으로 실행이 될 수 있습니다.

############  FTP SCRIPT #####################
# You must have a netrc. file in the $HOME directory of the requesting
# user.
# The "rem_sys" must specify a system name or the netrc. file will not
# get read.

TEST=0    # 0 = get file , 1 = don't get
filerem_sys="hp001"    # Do not use an IP adx
rem_dir="/tmp"    # The directory where the file is located.
file="ftptestfile"    # The file to be transferred

if [ $TEST = 0 ]
Then
ftp << end
         open "$rem_sys"
         cd "$rem_dir"
         prompt
         get "$file"
         quit
end
else :
fi
###########  END OF SCRIPT ###################
조회 수 :
407
추천 수 :
4 / 0
등록일 :
2007.12.05
15:47:57 (*.236.3.225)
엮인글 :
http://bestceok.com/xe/index.php?mid=unix_com&document_srl=2722&act=trackback&key=68a
게시글 주소 :
http://bestceok.com/xe/index.php?mid=unix_com&document_srl=2722
List of Articles
번호 제목 글쓴이 날짜 조회 수
공지 자주 사용하는 명령어 제비게릴라 2019-06-27 179
72 console 에 뿌려지는 message를 file로 받고자 합니다. 하록 2008-03-04 550
71 syslog.conf설정하기 하록 2008-02-26 3446
70 OS백업을 받을때 /data가 있는 쪽만 빼고 vg00전체를 다 받고자 할때... 하록 2008-02-13 487
69 ll 명령어로 알파벳 대소문자 구분없이 정렬해서 출력하기... 하록 2008-02-01 530
68 ndd로 fin_wait_2 를 지울때 "invalid argument" message나올때 하록 2008-02-01 906
67 glance 기간별 평균 구하기... 하록 2008-01-29 593
66 glance 한달 평균 구하기... 하록 2008-01-29 463
65 LVM 방법 하록 2007-12-18 1352
64 shell command상에서는 잘 돌아가는데 cron을 통하면 작업이 잘 안 될때.. 하록 2007-12-05 529
63 cron log file에 return code가 나오는데 code number 의 의미 하록 2007-12-05 695
62 tftp서버 구축하기 하록 2007-12-05 478
61 100BT card의 speed와 duplex mode를 바꾸는 방법 하록 2007-12-05 913
60 TCP error에는 어떤 것이 있고 그 의미 하록 2007-12-05 1081
59 netstat -a'로 보아 어떤 port는 fin_wait2에 빠져 사용할 수 없는데 조치방법 하록 2007-12-05 447
» automatic ftp 를 설정하는 방법 하록 2007-12-05 407
57 Disk Array 1개에서 alter Path로 디스크가 2개 보일때 루트 미러링 잡는 방법 하록 2007-09-12 599
56 dd 사용법 [5] 하록 2007-08-13 1972
55 리눅스 rsh 설정 방법 하록 2007-03-05 3297
54 Trust system에서 패스워드 삭제... 하록 2007-02-15 638
53 LSOF 설치 및 사용가이드 하록 2006-12-04 766