使用psftp从多服务器(SFTP)获取文件

时间:2017-11-02 00:37:22

标签: batch-file sftp

我想使用psftp从许多服务器(SFTP)中恢复日志文件(txt)。 所以我制作批处理文件来访问服务器。 但当我执行downlad_all.bat时,它停止了Sent EOF消息 我应该怎么做才能在消息之后对过程进行限制?

----------命令日志(访问第一台服务器后)----------

Connected to <IP ADRRESS_01>
Remote working directory is ~~~
New local directory is D:/FindingLog\download
remote:/log/tmplog/20171018_2921.txt => local:20171018_2921.txt
remote:/log/tmplog/20171019_8310.txt => local:20171018_8310.txt
Sent EOF message

------- download_all.bat --------------

call down_from_01.bat
call down_from_02.bat
...
call down_from_XX.bat

------- down_from_01.bat --------------

psftp.lnk -b D:/FindingLog/auto.txt -l <ID> -pw <PASSWORD> -v <IP ADRRESS_01>

------- down_from_02.bat --------------

psftp.lnk -b D:/FindingLog/auto.txt -l <ID> -pw <PASSWORD> -v <IP ADRRESS_02>

------- down_from_XX.bat --------------

psftp.lnk -b D:/FindingLog/auto.txt -l <ID> -pw <PASSWORD> -v <IP ARDRESS_XX>

------- auto.txt --------------

lcd D:/FindingLog/download
mget "/log/tmplog/*.txt"
bye

0 个答案:

没有答案