How to automatically update a Team Fortress 2 server with SteamCMD

hostingteam-fortress-2windows

I have a Windows server running Team Fortress 2 (TF2) with SteamCMD and I would like to enable auto-updates.

For the moment, I have to do it manually with SteamCMD using the app_update command but this is very bad as I must check daily if there are new updates.

This is what I've tried :

  • The -autoupdate arg when I launch the game (srcds.exe -autoupdate ...)
  • Putting the SteamCMD commands in a text file and using the -steam_dir and -steam_script args

Is there an easy way to do this?

Best Answer

There is no way to 'push' updates to your server, only regular pulls.

First up: create a batch file to update in one click.

@echo off
start c:\steamcmd\steamcmd +login anonymous +force_install_dir c:\tf2server +app_update 232250 validate +quit

Replace relevant directories with where they appear in your system.

Next: do nightly restarts. There are plugins out there that will stop your server at a specific time of day. Create a operating system level scheduled task to run your update batch and then start the server again.

This is what I have implemented in my professional TF2 server; this is advice from an expert.