Rust - Dedicated Linux Server Admin Scripts¶
Just thought I'd put these out there... a few scripts that might prove useful to you if you run your own Rust dedicated server.
In case it's not obvious from the article title, these scripts are for Linux. They should run fine on RedHat and it's derivatives. All these scripts sit in the directory containing the dedicated server files.
The backup script¶
This is incredibly simple and lacks any form of error checking, but it shouldn't need to be that clever because unless you have no space or a serious hardware fault, there isn't a lot that can go wrong.
The steamcmd script¶
This probably shouldn't have a .sh extension, but hey... it means I don't have to include an additional copy in the backup script to ensure this gets backed up.
steamcmdupdate.sh | |
---|---|
You will notice that this is literally the same set of commands you would run manually to update the server.
The main start script¶
This is an incredibly simple script that basically runs the actual startup script in a screen session.
Note
This is the script you run to start the server (since you will then be able to detach from it using CTRL+A CTRL+D. You can then re-attach using screen -R <SCREENSESSIONNAME>).
The actual start script¶
You will no doubt notice that decay is turned off for quite a lot... the server I look after is a private server for a small collection of on-line friends. We don't want to be worrying about decay and having things like tug boats vanishing.
Note
You should only use this script to start the server for testing.
The update script¶
Since this could break an install, when you call ./update.sh, you must include confirm as the first and only parameter. Without this parameter the script will do nothing except tell you how to have it do it's job. Like the other scripts there is nothing in the way of error checking etc. If it fails you'll need to fix it up, but know that it uses the backup script to take a copy of the config and game data before it does the updates.
Important
Where there are items of data you need to supply, they are shown in the scripts surrounded by < and >
For example:- <USERNAME>
You will also notice that a certain directory structure is assumed.
/home/<USERNAME>
Steam
<SERVERDIRECTORY>
server
oxide
...
All of these script files reside in <SERVERDIRECTORY>
Disclaimer¶
These scripts are provided as is for reference/educational purposes only. Before you consider using them, you should make sure you are familiar with the commands they use and the general operation of steamcmd, the Rust dedicated linux server and the host operating system. By using them you acknowledge that you do so at your own risk and you agree that you will not hold me responsible for any losses (financial or otherwise) that may occur as a result of your use of these scripts.
I know they work for me with my setup but I make no guarantees they will work for anyone else and their setup, so if you use them, you do so at your own risk.