cronjobs
To automate LinuxGSM you can set scheduled tasks using cronjobs, to run any command at any given time.
Commonly used scheduled tasks are:
Automatically check for updates (update command)
Automatically check for server crash and restart if needed (monitor command)
Automatically keep LinuxGSM up to date (update-lgsm command)
Automatically restart the server at a given time (restart command)
Automatically update and restart the server (force-update command)
Crontab
To access and edit your cronjobs use crontab.
Cronjob as a user or root
It is possible to set up cronjobs as any user including root. The recommended way is to set up cronjobs using the game servers user account. However, If you run several game server installations on your server you may want to centrally manage cronjobs then using root.
User cronjob
Root cronjob
Cronjob Timing Examples
Every single minute
Every 30 minutes
Every hour
Every two hours
Every two hours at 30 minutes past the hour
Every day at 5:10 PM
Every Wednesday at 1 AM
Every Five Days at 1 AM
Cronjob Generator
If you are not used to setting up cronjobs you can use crontab.guru as a great reference to get started.
LinuxGSM Cronjobs examples
Replace username and gameserver with your own details.
Daily cronjob
Here is an example of a user based cronjob for a daily restart at 5 am.
Here is an example of a root based cronjob for a daily restart at 5 am.
Every X Time cronjobs
Here is an example of a user based cronjob to monitor your server every 5 minutes.
Here is an example of a root based cronjob to monitor your server every 5 minutes.
Complete Example
Below is a recommended basic example and will do the following:
Monitor your server every 5 minutes.
Check for an update every 30 minutes, update and restart only if an update is detected.
Restart and check for an update every day at 4:30 AM
Update check and update LinuxGSM every Sunday at midnight.
Last updated