将文件从FTP服务器复制到本地目录? [英] Copy files from FTP server to local directory?
问题描述
我要创建一个批处理文件,包括以下函数:
I want to create a batch file, including the following functions:
- 连接到FTP服务器
- 如果成功,则从其中复制文件(目录名为out)到本地目录
- 每15分钟重复这些步骤
- Connection to a FTP server
- Copying the files from there (directory called "out") to a local directory
- if success, then deleting the files from the FTP server
- repeating those steps every 15 minutes
到目前为止,我还没有对批处理文件这么做,如果你能帮助我。我知道有 ftp
命令,我知道如何连接( ftp open
),但不幸的是,
I haven't done that much with batch files so far, so it would be great if you could help me. I know there is the ftp
command, and I know how to connect (ftp open
), but unfortunately I don't know how to copy those files from there every 15 minutes.
非常感谢您的帮助!
推荐答案
要从批处理文件中编程ftp,请参阅 http://support.microsoft.com/kb/96269 。您需要像这样调用ftp
To program ftp from a batch file, see http://support.microsoft.com/kb/96269. You need to call ftp like this
ftp -s:ftpcommands.txt
其中ftpcommands.txt如下所示:
where ftpcommands.txt looks something like this:
open ftp.myftpsite.com
username
password
bin
cd out
mget *
del *
bye
对于每15分钟运行一次,请参阅其他回复( at
Scheduler)。
For running this every 15 minutes, see other replies (at
or Command Scheduler).
这篇关于将文件从FTP服务器复制到本地目录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!