1. I rent a server on gameservers.com. My server sometimes will crash(freeze?) without any error, so I have to click the "restart" button on the website. I want to modify the .bat file to make it auto restart on crash. I did some google search and I got this:

    Code:
    echo off
    cls
    echo SRCDS auto restart
    title Garry’s Mod auto restart
    :srcds
    echo (%time%) SRCDS started.
    start /wait srcds.exe
    echo (%time%) Your server just closed or crashed. RESTARTING!
    goto srcds

    My modified .bat file:
    Code:
    @echo off
    cls
    :start
    echo Starting server...start /wait RustDedicated.exe -batchmode -nographics +server.hostname "[Test]Isaac's Server|NoDecay|Events|HuntRPG|SkipNightVote|" +server.ip 0.0.0.0  +server.port 28015 +server.level "Procedural Map" +server.seed 3927 +server.worldsize 3000 +server.maxplayers 50 +server.identity "Isaac_OXIDE_server" +server.saveinterval 300 +server.globalchat true +rcon.ip 0.0.0.0 +rcon.port 28016 +rcon.password 00001 +query_port 28057 +server.description "Powered by Oxide"echo.
    echo Restarting server...
    timeout /t 10
    echo.
    goto start
    
    After adding start /wait, my console looks weird. (I did a test on my PC first.)
    54456456.PNG

    445465465.PNG

    Is this really the way to do it? The status of the server in the console keep moving up and down. (I can still joined the server.)

    ----------------------------

    *The server freeze after 13m11s and did not restart itself.
     
  2. Wulf

    Wulf Community Admin

    Any hosted server will not be able to use .bat scripts if they offer a control panel. You'd need to contact them for this.
     
  3. There is an option in your panel to restart server in a crash or it goes down
     
  4. 1465465465465.PNG
    Watchdog is not supported. :(

    45645644.PNG
    I thought I can put the start /wait here. (However this will not restart the server on my PC. :( )
     
  5. talk to your host also remove the -load from the startup bat that you see in that screenshot you posted as its no longer used
     
  6. I can edit it. Thank you!