Home > Back-end >  Routing a exe File to have a backup target when servers fail
Routing a exe File to have a backup target when servers fail

Time:05-24

I was wondering what solution is there to give a shortcut to a server, basically an exe, More that 1 target path to basically have the same application on 2 servers so that when one server fails, that the exe goes to the other target path and find the exact same application exe that the shortcut points to. Any solutions would be highly appreciated. Thanx

CodePudding user response:

Test if file exist (is reachable) on prefered server. If yes, start it. If no, start it from backup server. You have to adapt script paths to UNC path or mapped drives, depend on what you are using. UNTESTED:

set "path=path_to_exe"
set server1=hostname1
set server2=hostname2

if exist "%server1%\%path%\file.exe" (
   "%server1%\path%\file.exe"
   ) else (
   "%server2%\%path%\file.exe"
   )

CodePudding user response:

It`s impossible to achieve such only by a shortcut. You can find some opensource HA(high available) or clustering solutions.

  • Related