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:
After adding start /wait, my console looks weird. (I did a test on my PC first.)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
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.
Solved Automatically restarting on crash with a hosted server?
Discussion in 'Rust Discussion' started by IsaacLin, Jun 15, 2017.
-
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.
-
There is an option in your panel to restart server in a crash or it goes down
-
Watchdog is not supported.
I thought I can put the start /wait here. (However this will not restart the server on my PC. ) -
-