Raised This Month: $51 Target: $400
 12% 

SteamCMD autoupdate - gamehosting guide [linux]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
luki1412
Veteran Member
Join Date: Oct 2008
Location: OnPluginStart()
Old 06-17-2013 , 13:01   SteamCMD autoupdate - gamehosting guide [linux]
Reply With Quote #1

Hello guys, I had problems with autoupdate on this new steamcmd system so I wanted to help people having problems with this as well.

I have my server from my server hosting so it should work for you too.

You need FTP to your server and access to the start-up params of the srcds. Server is run by your provider so you probably dont have access to the steamcmd console or parameters.

It is usually running on linux.

I will use tf2 as an example but it should work for any steamcmd game - you have to change app id and path to the exact folders.

We need script to update the game server. I named my script update_tf.txt [attached to the post]

This is the code:
PHP Code:
@ShutdownOnFailedCommand 1
@NoPromptForPassword 1
login anonymous 
force_install_dir 
..
app_update 232250 validate
quit 
Change 232250 to id of your game. You can find them here .
Change .. in force_install_dir to path of your dir where tf folder is located according to the steamcmd folder. If you put wrong path in there it will start to download entire server again in the dir you wrote in there! Change login anonymous to your login info if you have...
Remove validate from the script if you dont want your server files to be validated every start of the server. You should leave it there at least for the first run.

This is my ftp folder with my server files for better explanation:

I wrote .. there because it means "go to the folder above". Thats the folder I have tf folder in.

Now save your script file and upload it to the steamcmd folder or any other folder but remember that you need exact path to it.

Now you need to edit your start up parameters.

Make sure you dont have anything twice in there.
Add this at the end : -autoupdate -steam_dir ~/steamcmd -steamcmd_script ~/steamcmd/update_tf.txt

Im using exactly this, but you can change them according to your server...
-autoupdate - enables autoupdate
-steam_dir - dir that steam.sh resides in. Example: ~/Steam
-steamcmd_script - path to the steam script to execute. Example: ~/Steamcmd/csgo_ds.txt

You HAVE to put all 3 parameters or none of them! If you put only -autoupdate in there, it will NOT start! It will just write an error that you dont have it there. If you put wrong path in there it will probably not start either. To disable autoupdate just remove these 3 parameters.

After this you have to restart your server and it will validate and download/update the server files.
If you put wrong path in there it will not start or download entire tf folder again... It will write everything in the server console so check your server console in your control panel...

This script works only if the server is restarted or you have plugin which checks the current version and restarts the server-this for example.

I hope this helped you and I apologize for my bad english :/
Attached Files
File Type: txt update_tf.txt (124 Bytes, 1088 views)
__________________
luki1412 is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 06-17-2013 , 15:39   Re: SteamCMD autoupdate - gamehosting guide [linux]
Reply With Quote #2

Seems like I made a post like this before.

Having said that, I updated the Team Fortress wiki with updated SteamCmd instructions for Windows and Linux
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
luki1412
Veteran Member
Join Date: Oct 2008
Location: OnPluginStart()
Old 06-17-2013 , 16:06   Re: SteamCMD autoupdate - gamehosting guide [linux]
Reply With Quote #3

Well then its not visible or wrong tags ... was googling a lot and it was not in there... also you have a lot of stuff in there ... this is much simpler...
Good to have your links here though... someone may find them useful
__________________
luki1412 is offline
Automicbomb
AlliedModders Donor
Join Date: Nov 2012
Old 09-21-2013 , 04:04   Re: SteamCMD autoupdate - gamehosting guide [linux]
Reply With Quote #4

Remove the following from the script and it works fine:
PHP Code:
@ShutdownOnFailedCommand 1
@NoPromptForPassword 1 
Those are nothing to do with linux and works only on Windows machines. I removed it and works fine.

EDIT: Updated to TF2 Wiki

Last edited by Automicbomb; 09-21-2013 at 04:08.
Automicbomb is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 09-21-2013 , 14:42   Re: SteamCMD autoupdate - gamehosting guide [linux]
Reply With Quote #5

Quote:
Originally Posted by Automicbomb View Post
Remove the following from the script and it works fine:
PHP Code:
@ShutdownOnFailedCommand 1
@NoPromptForPassword 1 
Those are nothing to do with linux and works only on Windows machines. I removed it and works fine.

EDIT: Updated to TF2 Wiki
@ShutdownOnFailedCommand prevents the script from trying to run additional commands if one has failed and also produces a return code on the command prompt to detect that it has errored.

They work fine on Linux and I am, in fact, using them on my own server right now alongside Nemrun for SteamCMD... which can detect when steamcmd exits with a non-standard return value and know that the update failed.

What's more, those two commands were supplied by Valve's Fletcher Dunn as part of the example SteamCMD install script back when TF2 SteamCMD was still in Beta.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 09-21-2013 at 14:44.
Powerlord is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 22:52.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode