How to Automate Game Server Backups: Scheduling Restarts and World Saves Without Player Downtime

Why Backup Automation Matters for Game Servers

A corrupted world save can wipe out weeks of player progress. A crashed server at 3 AM with no one awake to restart it means hours of lost playtime. Automating backups, restarts, and world saves is not optional — it is the difference between a server players trust and one they abandon.

This guide covers practical automation techniques for Linux and Windows dedicated game servers, focusing on zero-downtime approaches that keep players connected during maintenance operations.

Understanding World Saves vs Backups

There are two distinct concepts you need to automate:

  • World saves: The game server periodically writes the current state to disk. This happens every 15–30 minutes in most games. If the server crashes, you lose at most the time since the last save.
  • Backups: A copy of the world save directory, stored externally. If the save file becomes corrupted, you can restore from a backup. Backups should happen less frequently (every 4–24 hours) and be retained for days or weeks.

Step 1: Configure In-Game Auto-Save Intervals

Every major game server allows you to configure auto-save frequency. Here are the settings for popular games:

GameSettingDefault IntervalRecommended Interval
Minecraftauto-save-interval in server.properties5 seconds (always saving)Keep default (lightweight)
ARKAutoSavePeriodMinutes in GameUserSettings.ini15 minutes15 minutes (causes brief stutter)
PalworldAutoSaveIntervalSeconds in PalWorldSettings.ini30 seconds120 seconds (reduces stutter)
Rustsaveinterval server console command5 minutes5 minutes
ValheimHardcoded ~20 minutes20 minutesN/A (not configurable)

Step 2: Create an Automated Backup Script (Linux)

Here is a production-ready backup script for Linux game servers. It creates compressed, timestamped backups and uploads them to remote storage.

#!/bin/bash
# /usr/local/bin/game-backup.sh
# Run this via cron. Adjust GAME_DIR and BACKUP_DIR for your setup.

GAME_DIR="/home/gameserver/ark"
BACKUP_DIR="/backups/ark"
RCLONE_REMOTE="mycloud:game-backups/ark"
RETENTION_DAYS=7

# Create backup directory if missing
mkdir -p "$BACKUP_DIR"

# Create timestamped archive
tar czf "$BACKUP_DIR/ark-$(date +%Y%m%d-%H%M).tar.gz" -C "$GAME_DIR" ShooterGame/Saved/

# Remove backups older than retention period
find "$BACKUP_DIR" -name "ark-*.tar.gz" -mtime +$RETENTION_DAYS -delete

# Upload to remote storage (optional)
if command -v rclone &> /dev/null; then
    rclone sync "$BACKUP_DIR" "$RCLONE_REMOTE" --backup-dir="$RCLONE_REMOTE/old"
fi

# Keep only last 48 hourly backups
ls -t "$BACKUP_DIR"/*.tar.gz | tail -n +49 | xargs -r rm

Install this script and add it to cron:

# Run backup every 4 hours
0 */4 * * * /bin/bash /usr/local/bin/game-backup.sh

# Run world-save-specific backup every hour (lighter)
0 * * * * /usr/local/bin/game-save-only.sh

Step 3: Schedule Graceful Restarts

Restarting a game server while players are online does not have to mean kicking everyone. Most game server frameworks support graceful restarts with warnings and save commands.

ARK (using RCON)

#!/bin/bash
# ark-graceful-restart.sh
RCON_HOST="localhost"
RCON_PORT=27020
RCON_PASS="your-rcon-password"

# Announce restart
rcon -H $RCON_HOST -p $RCON_PORT -P $RCON_PASS "Broadcast Server restarting in 5 minutes"
sleep 240
rcon -H $RCON_HOST -p $RCON_PORT -P $RCON_PASS "Broadcast Server restarting in 60 seconds"
sleep 50
rcon -H $RCON_HOST -p $RCON_PORT -P $RCON_PASS "Broadcast Server restarting in 10 seconds"
sleep 10

# Force save
rcon -H $RCON_HOST -p $RCON_PORT -P $RCON_PASS "SaveWorld"
sleep 5

# Shutdown
rcon -H $RCON_HOST -p $RCON_PORT -P $RCON_PASS "DoExit"
sleep 10

# Start the server again (adjust path as needed)
systemctl restart ark-server

Minecraft

# Use the Minecraft server console via screen/tmux or RCON
screen -S minecraft -X stuff "say Server restarting in 5 minutes^M"
sleep 240
screen -S minecraft -X stuff "say Server restarting in 60 seconds^M"
sleep 50
screen -S minecraft -X stuff "say Server restarting in 10 seconds^M"
sleep 10
screen -S minecraft -X stuff "save-all^M"
sleep 5
screen -S minecraft -X stuff "stop^M"
sleep 15
systemctl restart minecraft-server

Step 4: Remote Backup Without Player Impact

The key to zero-downtime backups is to copy files from a snapshot rather than the live game directory. Here are three approaches:

  1. Filesystem snapshots (LVM/ZFS): Create a read-only snapshot of the game server volume, mount it, and back up from the snapshot. This takes seconds and does not interrupt the game.
  2. Rsync + –delay-updates: Rsync creates a consistent copy of the directory without locking files. Use rsync -a --delay-updates /game/world/ /backup/world/.
  3. Game-native backup commands: Many games have a console command like save-all (Minecraft) or SaveWorld (ARK) that writes all data to disk. Run this before backing up.

Step 5: Monitor and Alert on Backup Failures

A backup that silently fails is worse than no backup — it gives you false confidence. Add monitoring to your automation:

# Add to the end of your backup script
if [ $? -eq 0 ]; then
    # Send success metric (e.g., to Healthchecks.io or Uptime Kuma)
    curl -fsS -m 10 --retry 5 "https://hc-ping.com/YOUR-UUID"
else
    # Send failure alert
    curl -fsS -m 10 --retry 5 "https://hc-ping.com/YOUR-UUID/fail"
    # Also send email or Discord webhook
    curl -H "Content-Type: application/json" -d '{"content":"Backup FAILED for ARK server!"}' \
        "https://discord.com/api/webhooks/YOUR-WEBHOOK"
fi

Sample Complete Cron Schedule

# m h dom mon dow command
# Daily restart with warning (3 AM when player count is lowest)
0 3 * * * /usr/local/bin/game-graceful-restart.sh

# Hourly lightweight save-only backup
0 * * * * /usr/local/bin/game-save-only.sh

# Full backup every 4 hours
0 */4 * * * /usr/local/bin/game-backup.sh

# Remote sync once daily
0 5 * * * /usr/local/bin/game-remote-sync.sh

Final Checklist

  • [ ] In-game auto-save configured with reasonable interval
  • [ ] Backup script installed and tested (restore a backup to verify)
  • [ ] Cron jobs set up with proper logging
  • [ ] Remote backup destination configured (S3, B2, rsync.net, etc.)
  • [ ] Graceful restart script with player warnings
  • [ ] Monitoring/alerts for backup failures
  • [ ] Retention policy configured (delete old backups to save space)

Proper backup automation transforms your game server from a hobby project into a reliable service. Players notice the difference — a server that never resets without warning and never loses progress builds a loyal community.

For reliable 24/7 operation of these automations, compare dedicated server plans on our comparison page to find the right hardware with the CPU performance and fast storage your game server needs.

Leave a Reply