Send a file by sftp to a clustered server

Advertisement

mounir82
Guest

Send a file by sftp to a clustered server

Hi all,

I have a clustered SFTP server 192.168.1.10 and 192.168.1.20, and am wondering if there is a way to switch uploading files to the second server in case the first server is unreachable.
Always sending to the server 192.168.1.10 but if the server is unreachable I send to 192.168.1.20

Regards

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,378
Location:
Prague, Czechia

Re: Send a file by sftp to a clustered server

You can try to upload to one server and if the uploads fail (for whatever reason), retry the same script against a different server.
Start with this:
https://winscp.net/eng/docs/script_upload_multiple_servers
Just modify the batch file like this:
winscp.com /script=script.txt /parameter sftp://user:password@192.168.1.10/
if errorlevel 1 (
  winscp.com /script=script.txt /parameter sftp://user:password@192.168.1.20/
)

Reply with quote

Advertisement

You can post new topics in this forum