2013-04-25 3 views
0

FTP 스크립트를 만들었지 만 원격 FTP의 파일 목록을 로깅해야합니다 (ls 또는 dir 결과) 이제 로그 파일 만 가져옵니다.FTP에서 dir을 로그하는 방법

: FTP는하지 결과

get.bat

ftp -v -n -i -s:D:\AX\get.ftp >>D:\AX\ftplog.txt 

get.ftp

open ftp.xxxxxx.xx 
user xxxxxxx 
xxxxxxxx 
binary 
cd /OUT 
ASCII 
ls >>D:\AX\ftplog.txt 
lcd "\Import" 
mget *.* s 
mdelete *.* 
bye 

결과, 명령

open ftp.xxxxxx.xx 
user xxxxxx 
binary 
cd /OUT 
ASCII 
ls >>D:\AX\ftplog.txt 
lcd "\Import" 
mget *.* s 
bye 

과 내가보고 싶은 것은 :

230 Login successful. 
ftp> dir 
200 PORT command successful. Consider using PASV. 
150 Here comes the directory listing. 
drwxrwxrwx 2 ftp  ftp   4096 Apr 25 10:10 IN 
drwxrwxrwx 2 ftp  ftp   4096 Apr 24 15:39 OUT 
226 Directory send OK. 
ftp: 121 bytes received in 0,02Seconds 7,56Kbytes/sec. 

내가

+0

에서 매개 변수를 제거하지? –

답변

2

FTP -?를 읽고 문서에 따르면,

-v를 의미의 -v 매개 변수를 알 그렇게 어떻게원격 서버 응답 표시를 억제합니다.

때문에, 오른쪽, DOS 창이어야 명령 줄

ftp -n -i -s:D:\AX\get.ftp >>D:\AX\ftplog.txt 
관련 문제