简体   繁体   English

批处理文件,用于从服务器下载和删除文件

[英]A batch file to download and delete files from a server

How can I write a MS dos ftp batch file to: 如何将MS Dos ftp批处理文件写入:

  1. download files from the server to my local pc 将文件从服务器下载到我的本地PC
  2. remove these files from the server after download 下载后从服务器中删除这些文件

Edit: 编辑:

So far I have... 到目前为止我有......

Batch file: 批处理文件:

ftp.exe -s:ftp.txt ftp.exe -s:ftp.txt

FTP.txt: FTP.txt:

open domain.com 打开domain.com

usernamehere usernamehere

passwordhere passwordhere

cd /httpdocs/store/files cd / httpdocs / store / files

need get, list and delete commands here?? 需要在这里获取,列出和删除命令?

quit 放弃

From one of my cuestions in other post. 从我在其他职位上的一项经验。

user-name
user-password
lcd c:\localfolder-where-download
cd remote-folder
mget .  
mdelete \\remote-folder\ .
quit

1 & 2 line , your credentials 3 - line local folder where the ftp can download the content 4- line - remote folder if needed 5- line - get al content to your local folder 6- line - delete all content from your remote folder 7- line quit! 1&2行,您的凭据3行-ftp可以在其中下载内容的本地文件夹4-行-如果需要的话,远程文件夹5-行-将所有内容发送到本地文件夹6-行-从远程文件夹中删除所有内容7 -退出!

ftp.exe程序可以将某种脚本文件作为输入 (该示例上载了文件,但是我想知道了),因此您应该能够为需要执行的命令创建脚本,然后使用适当的输入创建一个批处理文件,启动ftp.exe。

you can download ncftpput/ncftpget . 您可以下载ncftpput / ncftpget With ncftpget , there's option to remove remote files after downloading. 使用ncftpget ,可以选择下载后删除远程文件。

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

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