0

me again :P I have some problems with some bat file, that bat file , connects to and ftp and download all files from a remote folder, then delete it, but my problem/question is: i need a txt(log) of every file before download it from the remote server, here is my file

bat file:

ftp -i -s:ftpfile.txt site.com

txt file

user-name
user-pass
lcd c:\localfolder\some\folder
cd remotefolder-name
mget . 
mdelete \\remotefolder-name\ .
quit

If i use the >>mylog.txt on this line:

ftp -i -s:ftpfile.txt site.com>>mylog.txt

I get some extra data that i dont want to. I just need the file names before download it, something like this:

log.txt

file001x.xml
filedfx.xml
file023x.xml
filed33x.xml

Ps:sorry for my english ;)

4

1 回答 1

0

您可以将ls输出重定向到本地文件。语法是:ls pattern local_file. 一个例子是:ls * ftplist.txtls . ftplist.txt。两者都将生成一个文件ftplist.txt(如果您未指定路径,则在本地当前目录中),其中包含远程服务器当前目录中的文件列表(可能还有子目录)(格式略有不同)

于 2012-10-02T18:16:35.303 回答