简体   繁体   English

Windows FTP命令行客户端不下载带有mget的所有文件*

[英]Windows FTP command-line client does not download all files with mget *

I use batch file to FTP into remote and try to download all files in the specific directory using mget *.* . 我使用批处理文件将FTP传输到远程服务器,并尝试使用mget *.*下载特定目录中的所有文件。 But during transfer, it does not download all files. 但是在传输过程中,它不会下载所有文件。

This is my script: 这是我的脚本:

open 192.168.31.93
*user*
*password*
binary
cd *directory*
mget *.*
close

Output of the script: 脚本输出:

ftp> Connected to 192.168.31.95.

open 192.168.31.95
220 i4hp FTP server (Version 1.7.212.2 Tue Apr 21 12:14:46 GMT 1998) ready.
User (192.168.31.95:(none)): ---> 
USER ifour
331 Password required for ifour.
---> 
PASS ifour22
230 User ifour logged in.
ftp> Interactive mode Off .

ftp> prompt
---> binary
TYPE I
200 Type set to I.
ftp> ---> cd /console/i4/work/job/hd/bin
CWD /console/i4/work/job/hd/bin
250 CWD command successful.
ftp> ---> ls
TYPE A
---> PORT 192,168,31,93,16,208
200 PORT command successful.
---> NLST
150 Opening ASCII mode data connection for file list.
file.dbv

errlog

file.db

para.job

job.exp

job.exp.b

.SF.pickupdb.wind

.SF.pickupdb.ptype

.SF.dbnichijor

.SF.dbnichijor2

.SF.db.JOBD.Main

lockfile

.SF.db.JOBD.Main.PP.revc

.SF.db.JOBD.Main.pconect.revc

.SF.db.JOBD.Main.ftype.revc

.SF.db.JOBD.Edit

.SF.db.JOBD.Edit.PP.revc

.SF.db.JOBD.Edit.pconect.revc

.SF.db.JOBD.Edit.ftype.revc

.SF.db.queued.Daemon

.SF.db.JOBD.Main.Pi.fffb0000:0

.SF.db.JOBD.Main.Pi.fffb0000:1

.SF.db.JOBD.Main.Pi.fffb0000:2

.SF.db.JOBD.Main.Pi.fffb0000:3

.SF.db.JOBD.Main.Pi.fffb0000:4

.SF.db.JOBD.Main.Pi.fffb0000:5

.SF.db.JOBD.Main.Pi.fffb0000:6

.SF.db.JOBD.Main.Pi.fffb0000:7

.SF.db.JOBD.Main.Pi.fffb0000:8

.SF.db.JOBD.Main.Pi.fffb0000:9

.SF.db.JOBD.Main.Pi.fffb0000:10

.SF.db.JOBD.Main.fffb09

.SF.db.JOBD.Main.fffb0b

.SF.db.JOBD.Main.fffb0a

.SF.db.JOBD.Main.fffb08

... (lots of files omitted)

226 Transfer complete.
ftp: 34913 bytes received in 0.25Seconds 139.65Kbytes/sec.

---> TYPE I
ftp> ---> mget *.*
TYPE A
---> PORT 192,168,31,93,16,209
---> NLST *.*
---> TYPE I
200 Type set to I.
---> PORT 192,168,31,93,16,210
200 PORT command successful.
---> RETR file.db
150 Opening BINARY mode data connection for file.db (134437620 bytes).
226 Transfer complete.
ftp: 134437620 bytes received in 120.22Seconds 1118.28Kbytes/sec.

---> PORT 192,168,31,93,16,213
200 PORT command successful.
---> RETR file.dbv
150 Opening BINARY mode data connection for file.dbv (42766240 bytes).
226 Transfer complete.
ftp: 42766240 bytes received in 38.36Seconds 1114.89Kbytes/sec.

---> PORT 192,168,31,93,16,221
200 PORT command successful.
---> RETR job.exp
150 Opening BINARY mode data connection for job.exp (14752535 bytes).
226 Transfer complete.
ftp: 14752535 bytes received in 13.25Seconds 1113.40Kbytes/sec.

---> PORT 192,168,31,93,16,222
200 PORT command successful.
---> RETR job.exp.b
150 Opening BINARY mode data connection for job.exp.b (12997544 bytes).
226 Transfer complete.
ftp: 12997544 bytes received in 11.78Seconds 1103.26Kbytes/sec.

---> PORT 192,168,31,93,16,223
200 PORT command successful.
---> RETR para.job
150 Opening BINARY mode data connection for para.job (76751 bytes).
226 Transfer complete.
ftp: 76751 bytes received in 0.22Seconds 350.46Kbytes/sec.

ftp> ---> disconnect
QUIT
221 Goodbye.
ftp> quit

mget <mask> command in Windows command-line ftp client internally uses NLST <mask> FTP protocol command. Windows命令行ftp客户端中的mget <mask>命令在内部使用NLST <mask> FTP协议命令。 Your FTP server does not return the "dot" files for NLST * (probably because it considers them hidden). 您的FTP服务器不会为NLST *返回“点”文件(可能是因为它们认为它们是隐藏的)。

You will have to use another FTP client, which does not leave file mask resolution to the server. 您将不得不使用另一个FTP客户端,该客户端不会将文件掩码解析留给服务器。

For example with WinSCP FTP client , this will work: 例如,对于WinSCP FTP client ,它将起作用:

winscp.com /ini=nul /log=ftp.log /command ^
    "open ftp://user:password@192.168.31.93/" ^
    "cd /remote/directory" ^
    "mget *" ^
    "exit"

There's even a guide for converting ftp script to WinSCP script . 甚至还有ftp脚本转换为WinSCP脚本的指南

(I'm the author of WinSCP) (我是WinSCP的作者)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM