background image
Game Servers 380 7 Days to Die 4 Abiotic Factor 2 Aloft 2 alt:V 2 Americas Army Proving Grounds 2 Among Us 2 Archean 2 ARK Survival Ascended 6 ARK Survival Evolved 3 Arma 3 3 Arma Reforger 2 Aska 2 AssaultCube 2 Assetto Corsa 3 Astro Colony 2 Astroneer 2 Automobilista 2 2 Avorion 2 Banana Shooter 2 Barotrauma 3 BATTALION Legacy 2 BeamNG.drive (BeamMP) 2 Black Mesa 2 Brickadia 2 Call of Duty 2 Citadel: Forged with Fire 2 ClassiCube 2 Clone Hero 2 Colony Survival 2 Conan Exiles 4 Contagion 2 Core Keeper 2 Counter-Strike 2 3 Craftopia 2 CryoFall 2 CS2D 2 Cube 2: Sauerbraten 2 Cubic Odyssey 2 DayZ 4 DDNet 2 DDRaceNetwork 2 Dead Matter 2 Dont Starve Together 4 Eco 2 Empyrion Galactic Survival 2 Enshrouded 3 Escape from Tarkov 2 Euro Truck Simulator 2 2 Factorio 2 Farming Simulator 25 2 Fistful of Frags 2 FiveM 3 FortressCraft Evolved 2 Foundry 2 Foundry VTT 2 Frozen Flame 2 FTL Tachyon 2 Garrys Mod 3 Ground Branch 2 Half-Life 2 Deathmatch 2 Hogwarp 2 Holdfast: Nations at War 2 HumanitZ 2 Hurtworld 2 Hytale 1 Icarus 2 Insurgency Sandstorm 2 IOSoccer 2 Just Cause 3 Multiplayer 2 Kerbal Space Program 2 Killing Floor 2 3 LeagueSandbox 2 Left 4 Dead 2 Left 4 Dead 2 3 Longvinter 2 Los Angeles Crimes 2 Medal of Honor 2 Midnight Ghost Hunt 2 Mindustry 2 Minecraft 4 Minetest 2 Modiverse 2 Mordhau 3 Mount & Blade II: Bannerlord 2 Myth of Empires 2 Nazi Zombies Portable 2 Necesse 2 NeosVR 2 Neverwinter Nights EE 2 Night of the Dead 2 Nightingale 2 No Love Lost 2 No More Room in Hell 2 No One Survived 2 Nova-Life Amboise 2 Nuclear Option 2 Onset 2 Open Fortress 2 OpenArena 2 OpenRA 2 OpenRCT2 2 OpenTTD 2 Operation Harsh Doorstop 2 Palworld 3 Path of Titans 2 Pavlov VR 3 PixARK 2 Plains of Pain 2 Portal Knights 2 Post Scriptum 2 Project Zomboid 8 Puck 2 Quake Live 2 R5Reloaded 2 RedM 2 Renown 2 Resonite 2 Return to Moria 2 Rimworld Together 2 Rising World 2 Risk of Rain 2 1 Rust 4 Satisfactory 1 SCP Secret Laboratory 3 SCUM 2 Smalland 2 Solace Crafting 2 Soldat 2 Soldat 2 2 Sonic Robo Blast 2 2 Sons of the Forest 2 Soulmask 2 SourceCoop 2 Space Engineers 3 Space Station 14 2 Squad 3 Starbound 3 StarMade 2 Stationeers 2 Stormworks 2 Subnautica Nitrox 2 Sunkenland 2 SuperTuxKart 2 Sven Co-op 2 Swords 'n Magic and Stuff 2 Team Fortress 2 3 Teeworlds 2 Terraria 3 TerraTech Worlds 2 TF2 Classified 2 The Forest 3 The Front 2 The Isle 2 Tower Unite 2 Trackmania 2 Unturned 4 Urban Terror 2 V Rising 3 Valheim 3 VEIN 2 Veloren 2 Vintage Story 3 Voyagers of Nera 2 Wolfenstein: Enemy Territory 2 Wreckfest 2 Wurm Unlimited 2 Xonotic 2 Zandronum 2 Getting Started 2 Network & Connectivity 1 Server Management 2
Categorie

How to Set Up Scheduled Restarts

restart schedule cron automation 0 hanno trovato utile questo articolo

Game servers benefit from regular restarts to clear memory leaks, apply configuration changes, and keep performance stable over long play sessions. This guide shows you how to set up automatic scheduled restarts using the Schedules feature in GPanel, so your server stays healthy without manual intervention.

Works for all games. The Schedules feature in GPanel is available for every game server hosted with Legion Hosting. Game-specific tips (such as warning players before a restart) are covered later in this guide.

Why Schedule Restarts?

Most game servers accumulate memory usage and temporary data over time. Without periodic restarts, you may notice:

  • Increasing lag and rubber-banding as RAM usage climbs over hours or days
  • Entity and chunk loading slowdowns in games like Minecraft and Project Zomboid
  • Mod-related memory leaks that only reset on a full server restart
  • Delayed application of config changes that require a restart to take effect

A scheduled restart every 6 to 12 hours is the most common setup and prevents the majority of these issues.

Prerequisites

  • An active game server with Legion Hosting
  • Access to GPanel with your account credentials
  • Your server should be in a Running state (schedules only trigger when the server is online, unless configured otherwise)

Step 1: Open the Schedules Tab

  1. Log in to GPanel and select your server from the server list.
  2. In the left sidebar, click the Schedules tab.
  3. You will see a list of any existing schedules. If this is a new server, the list will be empty.

Step 2: Create a New Schedule

  1. Click the Create Schedule button.
  2. Enter a Name for the schedule — something descriptive like Auto Restart Every 6 Hours.
  3. Set the Cron Expression to control when the schedule runs. See the section below for common examples.
  4. Make sure Enabled is toggled on.
  5. Click Save to create the schedule.
The schedule is just a timer. After creating the schedule, you still need to add a task to it that tells the server what to do when the timer fires. Continue to Step 3.

Step 3: Add a Restart Task to the Schedule

  1. After saving the schedule, click on its name to open it.
  2. Under the Tasks section, click New Task.
  3. Set the Action to Send power action.
  4. Set the Payload to Restart.
  5. Set the Time Offset to 0 seconds (this means the task runs immediately when the schedule fires).
  6. Click Save.

Your scheduled restart is now active. The server will automatically restart according to the cron expression you configured.

Restart vs. Stop + Start: The Restart power action gracefully stops the server and starts it again. This is the recommended action for scheduled restarts. Avoid using Kill as a scheduled action, as it forcefully terminates the server process without saving.

Understanding Cron Expressions

GPanel uses cron expressions to define when a schedule runs. A cron expression has five fields separated by spaces:

Minute  Hour  Day-of-Month  Month  Day-of-Week
  *       *        *           *        *
Field Allowed Values Description
Minute 0–59 The minute of the hour the task runs
Hour 0–23 The hour of the day (24-hour format)
Day of Month 1–31 The day of the month
Month 1–12 The month of the year
Day of Week 0–6 (0 = Sunday) The day of the week

Special characters:

  • * — matches every value (wildcard)
  • */N — matches every N intervals (e.g., */6 in the Hour field means every 6 hours)
  • , — separates multiple values (e.g., 0,12 means at 0 and 12)

Common Restart Schedules

Here are the most popular restart intervals and the cron expressions to use in GPanel:

Restart Frequency Cron Expression Restarts At (Server Time)
Every 6 hours 0 */6 * * * 12:00 AM, 6:00 AM, 12:00 PM, 6:00 PM
Every 8 hours 0 */8 * * * 12:00 AM, 8:00 AM, 4:00 PM
Every 12 hours 0 0,12 * * * 12:00 AM, 12:00 PM
Once daily (4:00 AM) 0 4 * * * 4:00 AM
Once daily (6:00 AM) 0 6 * * * 6:00 AM
Every 3 hours 0 */3 * * * 12 AM, 3 AM, 6 AM, 9 AM, 12 PM, 3 PM, 6 PM, 9 PM
Recommended: For most game servers, restarting every 6 to 12 hours provides the best balance between uptime and performance. Heavily modded servers (especially Project Zomboid with 50+ mods) may benefit from restarting every 3 to 6 hours.

Warning Players Before a Restart

Restarting without warning can interrupt players mid-action, causing frustration or lost progress. You can use GPanel's Send Command task to broadcast a warning message to players before the restart happens.

How It Works

Instead of a single restart task, you create multiple tasks within the same schedule, staggered with time offsets:

  1. A Send Command task at offset 0 that broadcasts a warning message (e.g., "Server restarting in 5 minutes")
  2. A Send Command task at offset 240 (4 minutes later) with a final warning (e.g., "Server restarting in 1 minute")
  3. A Send power action → Restart task at offset 300 (5 minutes after the first warning)
Time offsets are in seconds. When adding tasks to a schedule, the Time Offset field specifies how many seconds after the schedule fires the task should execute. Use 0 for immediately, 60 for 1 minute, 300 for 5 minutes, etc.

Example: Full Schedule with Warnings

Here is what a complete schedule looks like with a 5-minute warning, a 1-minute warning, and the restart:

Task # Action Payload / Command Time Offset
1 Send command (game-specific warning command — see below) 0 seconds
2 Send command (game-specific final warning command) 240 seconds
3 Send power action Restart 300 seconds

Game-Specific Warning Commands

The command you use to broadcast a message to players varies by game. Below are the commands for the most popular games:

Project Zomboid

Use the servermsg command to send an in-game message to all connected players:

servermsg "Server restarting in 5 minutes. Please find a safe location."
servermsg "Server restarting in 1 minute!"

Minecraft

Use the say command to broadcast a chat message to all players:

say Server restarting in 5 minutes. Please save your progress.
say Server restarting in 1 minute!

ARK: Survival Ascended

Use the broadcast command to display a message on-screen for all players:

broadcast Server restarting in 5 minutes. Please find a safe location.
broadcast Server restarting in 1 minute!
Other games: If your game is not listed above, check the game's documentation or community wiki for the server console command that broadcasts a message to all players. Enter the command in the Payload field of the Send Command task. If you are unsure, open a support ticket and we will help you find the right command.

Best Practices

  • Restart during off-peak hours. If your server has a predictable player schedule, time the restarts for when the fewest players are online. A daily restart at 4:00 AM or 6:00 AM works well for most communities.
  • Always include a warning. Even a 1-minute warning gives players time to reach a safe location or finish a trade. A 5-minute warning is ideal.
  • Use backups alongside restarts. If your game or GPanel supports automatic backups, schedule a backup before the restart. This ensures you always have a recent save in case something goes wrong.
  • Don't restart too frequently. Restarting every hour is unnecessary for most servers and will frustrate players. Every 6 to 12 hours is the sweet spot unless you are running a heavily modded server with known memory leak issues.
  • Test your schedule. After creating a schedule, check back after the first expected trigger time to confirm the restart happened. Look at the GPanel Console log for the restart event.
  • Name your schedules clearly. Use descriptive names like "6h Auto Restart with Warning" so you can quickly identify what each schedule does.

Managing Existing Schedules

You can modify or disable schedules at any time from the Schedules tab in GPanel:

  • To edit a schedule: click the schedule name, change the cron expression or tasks, and click Save.
  • To temporarily disable a schedule: open the schedule and toggle Enabled off. The schedule will remain saved but will not fire until you re-enable it.
  • To delete a schedule: click the delete icon next to the schedule. This removes it permanently.

Troubleshooting

Problem What to Check
Schedule is not firing Open the schedule and confirm Enabled is toggled on. Double-check the cron expression — a common mistake is using incorrect field order. Ensure the server is online when the schedule is supposed to trigger.
Restart happens but warning message does not appear Make sure the Send Command task uses the correct command for your game. Verify the time offset is less than the restart task's offset (e.g., warning at 0 seconds, restart at 300 seconds).
Server does not come back online after restart Check the GPanel Console for startup errors. If the server crashed during shutdown, it may not restart cleanly. Try a manual Start from GPanel. If the problem persists, open a support ticket.
Cron expression not accepted GPanel requires exactly 5 fields in the cron expression (minute, hour, day of month, month, day of week). Do not include a seconds field. Ensure there are no extra spaces or special characters.
Warning command sends but players do not see it Some games require specific formatting. For Project Zomboid, the message must be in quotes: servermsg "Your message here". For Minecraft, say does not use quotes. Check the game-specific section above.

Need Help?

If you are having trouble setting up scheduled restarts or your schedule is not working as expected, open a support ticket and include:

  • Your server name from GPanel
  • The cron expression you are using
  • A description of what is happening (or not happening)

Our support team will help you configure the schedule correctly.


Questo articolo ti è stato utile?

Ready to Get Started?

The servers are booted, select your plan and become our latest satisfied client.