Skip to content

Commit ab0c970

Browse files
committed
feat: add check-update
1 parent 96f9ece commit ab0c970

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

commands/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Replace `./gameserver` with the actual script name. Every command has a short ve
1818
| [Monitor](monitor.md) | `./gameserver monitor` | `./gameserver m` |
1919
| [Test Alert](test-alert.md) | `./gameserver test-alert` | `./gameserver ta` |
2020
| [Update](update.md) | `./gameserver update` | `./gameserver u` |
21+
| [Check Update](check-update.md) | `./gameserver check-update` | `./gameserver cu` |
2122
| [Force Update](force-update.md) | `./gameserver force-update` | `./gameserver fu` |
2223
| [Validate](validate.md) | `./gameserver validate` | `./gameserver v` |
2324
| [Console](console.md) | `./gameserver console` | `./gameserver c` |

commands/check-update.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# check-update
2+
3+
LinuxGSM comes with an game server `check-update` command. All [SteamCMD](../steamcmd/) games servers are supported.
4+
5+
## Commands
6+
7+
Standard: `./gameserver check-update`
8+
9+
Short: `./gameserver cu`
10+
11+
Check-update will check for any available update, taking no action if no update is available. If there is an update it will send a alert if one is set up.
12+
13+
## Automatic check for avaliupdate
14+
15+
### Scheduled check for updates updates
16+
17+
A [cronjob](../configuration/cronjobs.md) can be set to run `check-update` at any given time.
18+
19+
Currently a cronjob is only makes sense if a [Alert](../alerts/README.md) is set up.
20+
21+
To edit cronjobs, type:
22+
23+
`crontab -e`
24+
25+
A cronjob can be run as the `gameserver user` or as `root`, this choice is down to personal preference. Remember to amend the examples to match a specific game server.
26+
27+
Here is an example of a user based cronjob to check for an update once an hour.
28+
29+
```text
30+
0 * * * * /home/username/gameserver check-update > /dev/null 2>&1
31+
```
32+
33+
Here is an example of a root based cronjob to check for an check-update once an hour.
34+
35+
{% hint style="info" %}
36+
The extra `su - username -c` indicates which user to run the script as.
37+
{% endhint %}
38+
39+
```text
40+
0 * * * * su - username -c '/home/username/gameserver update' > /dev/null 2>&1
41+
```
42+
43+
[crontab.guru](https://crontab.guru/) is a great resource to generate cronjobs.
44+

0 commit comments

Comments
 (0)