簡體   English   中英

服務器端FTP批處理腳本

[英]Serverside FTP Batch script

我一直在使用.bat腳本從FTP服務器僅下載pdf。

到目前為止,使用mget * pdf函數可以完美運行。

我最近移動了腳本,並使其從Windows 2012 Server運行。

現在,當腳本進入mget函數時,它將列出通常會傳輸的文件,但帶有?除外。 在每個實例之后,它將無法將其實際下載到LCD。

@ftp -v -n -i -s:C:\Users\LMCT\Desktop\Serversidesage\download-1.txt

這是被調用的FTP函數。

open xx.xxx.xx.xxx
user xxxxxxxxxxx
=xxxxxxxxxxxx
cd orders
lcd "C:\Users\LMCT\Desktop\Magento-downloaded-orders"
binary
prompt
mget *pdf
mdelete *pdf
quit

這是下載腳本。

有誰知道為什么會這樣?

提前致謝。

親切的問候,劉易斯。

默認情況下,交互式提示為開。 當您使用-I選項啟動FTP命令時,它將關閉“提示”。 在您的腳本中,然后使用PROMPT命令將其重新打開,然后退出您的MGET命令。

因此,如果PROMPT命令在您的FTP腳本中:

open ftp.domain.com
user ftpuser
password
prompt
quit

這很容易測試,看看發生了什么。

C:\BatchFiles\ftp>ftp -v -i -n -s:"script.txt" |find "Interactive"
Interactive mode On .

C:\BatchFiles\ftp>ftp -v -n -s:"script.txt" |find "Interactive"
Interactive mode Off .

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM