I've finally set up a rust server on a proper dedicated server.
Now I need to know how to manage auto restarts (daily, or every 12 hours) and restarts at possible server crashes.
Is this easily possible?
Thank you.
Scheduled restart setup?
Discussion in 'Rust Discussion' started by Axy, Jan 6, 2016.
-
Have the batch file auto-restart the server.
Example:
Code:@echo off :10 serverstarthere echo Restarting Server! goto 10
TimedExecute for Rust | Oxide -
Thank you fro your answer.
One small detail I forgot to mention: I need to find a solution that will work for both modded and unmodded servers (as only one of my servers is modded atm) -
Ah i see...
Assuming that both servers are running on the same server, you can use TASKKILL, also doing it this way will mean that you wont need a plugin on the oxide server either.
- Create a batch file, maybe in c:\scripts or something, call it KillRustServers.bat
- Create a new scheduled task in Windows to call this KillRustServers.bat every x hours or whatever you want your restart procedure to be.
- Inside KillRustServers.bat, put the following:
Code:TASKKILL /IM "RustDedicated.exe"
- Save the file, now whenever the scheduled task runs, the RustDedicated.exe processes will be told to shutdown gracefully, then your :10 goto 10 segment of the rust
servers batch file will take hold and restart the servers for you.
Please note:
TaskKill will kill ANY process running with the name given, if you have 10 RustDedicated.exe processes running, taskkill will send the stop command to each one.
-
Thanks for the detailed description.
The only section I need more explanation is section 4. What do you mean by :10 goto 10?
Also, is it possible to send a server message 10 minutes before the shutdown?
Thanks! -
No problem.
Sorry the :10 goto 10 is my programming side coming out, let me explain it more in depth.
You're servers starting batch file might look something like this:
Code:@echo off cls :startRustDedicated -batchmode -nographics +server.ip 0.0.0.0 +rcon.ip 0.0.0.0 +server.port 28015 +rcon.port 28016 +rcon.password "changeme" +server.maxplayers 10 +server.hostname "My Oxide Server" +server.identity "my_server_identity" +server.level "Procedural Map" +server.seed 12345 +server.worldsize 4000 +server.saveinterval 300 +server.globalchat true +server.description "Powered by Oxide" +server.headerimage "http://oxidemod.org/styles/oxide/logo.png" +server.url "http://oxidemod.org"@echo. @echo Restarting server... @echo. goto start
:start is the name of a label in a batch script, labels are like anchor points within a batch file, at any point you're able to tell the command processor to jump back to a label, you do this via goto LABELNAME (in this case, start).
So, here is what the batch file does:
- @echo off - This stops the command processor from printing such things as current working directory paths, it also makes using the 'echo' command more friendly.
- cls - this clears the command prompt screen of all text
- :start - create a new label here
- RustDedicated - Start the rust dedicated server, the command processor will stop here until the RustDedicated.exe process has ended.
- echo Restarting Server... - Echo "Restarting Server..." to the command prompt window
- goto start - Jump back up to the start label and continue execution (in this instance, it will jump back up to number 4)
In answer to your server message query, Yes! - but ONLY in your Oxide-Enabled server, you can again use the TimedExecute plugin for this.
While it could be done for your un-modded server, it's not currently possible unless someone builds a command-line RCON tool for Rust to push commands to the server before a shutdown is initiated.