![WinSCP SFTP 脚本 – 跳过不可用的主机而不是等待](https://linux22.com/image/1540855/WinSCP%20SFTP%20%E8%84%9A%E6%9C%AC%20%E2%80%93%20%E8%B7%B3%E8%BF%87%E4%B8%8D%E5%8F%AF%E7%94%A8%E7%9A%84%E4%B8%BB%E6%9C%BA%E8%80%8C%E4%B8%8D%E6%98%AF%E7%AD%89%E5%BE%85.png)
我有一个脚本,正在从远程服务器复制到我的本地 PC。批处理文件正在运行,但当 IP 10.223.19.51 关闭/断电时,脚本不会运行下一个命令行。它给我一个错误。请参阅下面的脚本。请帮忙。我希望即使其他服务器都关闭了,脚本也会继续运行,或者它会运行到下一个命令行。
C:\db_backup> cd\
C:> cd Program Files (x86)/
C:\Program Files (x86)> cd WinSCP/
C:\Program Files (x86)\WinSCP> winscp.com /script=POS.txt
Searching for host...
Network error: Connection to "10.223.19.51" timed out.
C:\Program Files (x86)\WinSCP> pause
Press any key to continue . . .
这是脚本:
open sftp://pos:[email protected]/
recv -neweronly /opt/simplepos/data/rsalphaland/*.zip C:\db_backup\POS\Lane1\
open sftp://pos:[email protected]/
recv -neweronly /opt/simplepos/data/rsalphaland/*.zip C:\db_backup\POS\Lane2\
open sftp://pos:[email protected]/
recv -neweronly /opt/simplepos/data/rsalphaland/*.zip C:\db_backup\POS\Lane3\
open sftp://pos:[email protected]/
recv -neweronly /opt/simplepos/data/rsalphaland/*.zip C:\db_backup\POS\Lane4\
open sftp://pos:[email protected]/
recv -neweronly /opt/simplepos/data/rsalphaland/*.zip C:\db_backup\POS\Lane5\
open sftp://pos:[email protected]/
recv -neweronly /opt/simplepos/data/rsalphaland/*.zip C:\db_backup\POS\Lane6\
open sftp://pos:[email protected]/
recv -neweronly /opt/simplepos/data/rsalphaland/*.zip C:\db_backup\POS\Lane7\
open sftp://pos:[email protected]/
recv -neweronly /opt/simplepos/data/rsalphaland/*.zip C:\db_backup\POS\Lane8\
exit
答案1
你可能正在寻找option batch
命令:
option batch continue