Rust Field guide

Automated Rust server wipe pipeline: scripts, seed rotation and data cleanup

Automate Rust dedicated server wipes: map and blueprint cleanup scripts, procedural seed randomization, pre-wipe backups, and cron scheduling.

Automated Rust server wipe pipeline: scripts, seed rotation and data cleanup

Scheduled server wipes in Rust are an indispensable part of server lifecycle management. Periodic world resets remove entity clutter, reduce CPU and storage overhead, and re-establish balanced early-game progression for the player base. Conducting wipes manually by hand is time-consuming and prone to catastrophic mistakes like accidental blueprint deletion or permission file removal.

This operational guide explains the architectural difference between map wipes and full blueprint wipes, the internal file layout of server.identity, writing a resilient Bash automation script with seed randomization, and scheduling cron executions.

Distinguishing map wipes from full blueprint wipes#

The Rust community separates wipe procedures into two distinct categories:

  1. Map Wipe: Purges player bases, deployed deployables, and the procedural world file. Player blueprint knowledge (researched tech tree items) is preserved. Typically executed weekly or bi-weekly.
  2. Full Wipe / BP Wipe: Purges the world map alongside all player blueprint databases, token registries, and progression stats. Mandatory on the first Thursday of every month alongside the global Facepunch update.

Accidentally deleting blueprint databases on a scheduled map wipe causes immediate player churn, making script-level separation between modes critical.

Internal file layout of the server.identity directory#

All dynamic game data is stored under /opt/rust/server/<server.identity>/:

  • proceduralmap.<size>.<seed>.<version>.sav: World save containing terrain modifications and player bases (deleted on map wipe).
  • player.blueprints.<version>.db: SQLite database storing unlocked crafting recipes (deleted only on full wipe).
  • player.identities.<version>.db and player.tokens.db: Steam identity caches (deleted on full wipe).
  • player.stats.<version>.db: In-game player statistics.
  • cfg/server.cfg: Core server ConVars (always preserved).
  • cfg/bans.cfg and cfg/users.cfg: Banlists and moderator credentials (always preserved).

Bash wipe automation script with random seed generation#

Create an automation script at /opt/rust/scripts/wipe.sh supporting both map and full modes. The script notifies active players via RCON, archives existing data, updates the procedural seed, and restarts the service:

bash
sudo mkdir -p /opt/rust/scripts /opt/rust/backups
sudo nano /opt/rust/scripts/wipe.sh

Insert the following automation script:

bash
#!/usr/bin/env bash
set -euo pipefail

MODE="${1:-map}"
IDENTITY="my_rust_server"
SERVER_DIR="/opt/rust/server/${IDENTITY}"
BACKUP_DIR="/opt/rust/backups/wipe_$(date +%Y%m%d_%H%M%S)"

echo "[1/6] Sending RCON broadcast..."
rcon -a 127.0.0.1:28016 -p "SuperSecretRconPass" "say Automated wipe starting in 60 seconds!" || true
sleep 60
rcon -a 127.0.0.1:28016 -p "SuperSecretRconPass" "server.save" || true

echo "[2/6] Stopping Rust server..."
systemctl stop rust

echo "[3/6] Archiving existing identity folder..."
mkdir -p "$BACKUP_DIR"
tar -czf "${BACKUP_DIR}/pre_wipe_archive.tar.gz" -C "/opt/rust/server" "${IDENTITY}"

echo "[4/6] Cleaning up data files according to mode: ${MODE}..."
find "$SERVER_DIR" -maxdepth 1 -name "proceduralmap.*.sav" -delete
find "$SERVER_DIR" -maxdepth 1 -name "*.map" -delete

if [ "$MODE" = "full" ]; then
    echo "Full wipe requested. Deleting blueprint and player databases..."
    find "$SERVER_DIR" -maxdepth 1 -name "player.blueprints.*.db" -delete
    find "$SERVER_DIR" -maxdepth 1 -name "player.identities.*.db" -delete
    find "$SERVER_DIR" -maxdepth 1 -name "player.tokens.db" -delete
    find "$SERVER_DIR" -maxdepth 1 -name "player.stats.*.db" -delete
fi

echo "[5/6] Generating new random seed..."
NEW_SEED=$(( (RANDOM << 16) | RANDOM ))
sed -i -E "s/(\+server\.seed )[0-9]+/\1${NEW_SEED}/" /etc/systemd/system/rust.service

echo "[6/6] Reloading systemd and starting Rust with seed ${NEW_SEED}..."
systemctl daemon-reload
systemctl start rust

echo "Wipe completed successfully. Seed: ${NEW_SEED}"

Make the script executable:

bash
sudo chmod +x /opt/rust/scripts/wipe.sh

When operating through an enterprise server management platform, scheduled wipes, procedural seed rotation, and blueprint snapshot retention are configured directly through automated cron tasks in the control panel.

Scheduling wipes with cron and RCON player alerts#

Open the system crontab under the root account:

bash
sudo crontab -e

Configure the routine schedule:

  • Map wipe scheduled every Thursday at 19:00 UTC:
  • Full wipe scheduled on monthly patch cycles:
bash
0 19 * * 4 /opt/rust/scripts/wipe.sh map >> /var/log/rust_wipe.log 2>&1

Trigger an immediate on-demand wipe anytime by providing the target mode argument:

bash
sudo /opt/rust/scripts/wipe.sh map

Verifying world generation and port validation#

After systemd re-engages the binary, monitor the procedural map generation in the system journal:

bash
sudo journalctl -u rust -f --no-pager

Confirm that the new world initialized cleanly: Generating Procedural Map [<size>, <new_seed>]Spawning Monuments... DoneServer initialization complete. Map loaded.

Verify that the process bound its listening UDP game port 28015 and TCP RCON port 28016:

bash
sudo ss -ulnp | grep 28015
sudo ss -tlnp | grep 28016

Sources#