> ## Content Index
> Fetch the complete content index at: https://blog.sudowl.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# Hytale Server Backups and Auto-Restart with systemd
- URL: https://blog.sudowl.com/hytale-server-backups-auto-restart-systemd/
- Published: 2026-06-20T10:00:00.000Z
- Updated: 2026-10-16T12:26:41.000Z
- Description: Keep a Hytale dedicated server alive — clean nightly world backups with tar + restic, a scheduled daily restart via systemd timer, and crash recovery.
- Author: Lukas
- Tags: Hytale, Gameserver, Linux

I run a Hytale server on a small Linux box, and the two things that actually keep it healthy aren't in any install guide: snapshot the world before something corrupts it, and restart it on a schedule before the memory creep gets bad. Both are systemd, no cron, no babysitting.

This assumes you already have the server installed and running under systemd. If not, start with [the prep guide](/hytale-server-install-guide-prep/) and [mods/plugins setup](/install-hytale-mods-plugins-guide/).

**TL;DR:**

```bash
# nightly: stop, snapshot the world dir, start, push offsite
systemctl stop hytale
tar -czf /srv/backups/hytale-$(date +%F).tar.gz -C /srv/hytale universe config.json permissions.json whitelist.json bans.json mods
systemctl start hytale
restic -r s3:s3.example.com/hytale-bak backup /srv/backups/hytale-$(date +%F).tar.gz

# daily restart at 06:00 via a systemd timer (below)

```

Details below.

## Where the world lives

Find your world/save directory first — everything else hangs off it. On my box the server is unpacked under `/srv/hytale`. The persistent world data is **not** in a `world/` folder (I had that wrong in an earlier version of this post) — it lives in `universe/` (with `worlds/`, `players/` and the memories file inside), next to `config.json`, `permissions.json`, `whitelist.json`, `bans.json` and `mods/`. Those are what you back up; skip the redownloadable binaries. Full breakdown in [Hytale server files explained](/hytale-server-files-explained/).

```bash
du -sh /srv/hytale/*        # find what's actually big and stateful

```

Don't just tar the whole install every night — the game files are dead weight you can re-fetch. Back up state, not the engine.

## Take a clean snapshot

The single most important word here is **clean**. Copying a world while the server is mid-write gives you a half-flushed, occasionally corrupt backup that looks fine until you try to restore it. Stop the service, snapshot, start it again. The downtime is a few seconds:

```bash
#!/usr/bin/env bash
# /usr/local/bin/hytale-backup.sh
set -euo pipefail
STAMP=$(date +%F-%H%M)
DEST=/srv/backups
mkdir -p "$DEST"

systemctl stop hytale
tar -czf "$DEST/hytale-$STAMP.tar.gz" -C /srv/hytale universe config.json permissions.json whitelist.json bans.json mods
systemctl start hytale

# keep 7 local, prune the rest
ls -1t "$DEST"/hytale-*.tar.gz | tail -n +8 | xargs -r rm --

echo "backup done: $DEST/hytale-$STAMP.tar.gz"

```

```bash
chmod +x /usr/local/bin/hytale-backup.sh

```

If a few seconds of downtime each night is too much for your crowd, warn players in-game first or pick an hour nobody's on. For most small servers, 03:00 is dead and nobody notices.

## Push it offsite

A backup on the same disk as the server isn't a backup — it dies with the box. Send the snapshot somewhere else. I use restic to an S3/MinIO bucket because it's encrypted and deduplicated, so nightly tarballs that mostly overlap barely cost any space:

```bash
export RESTIC_REPOSITORY="s3:s3.example.com/hytale-bak"
export RESTIC_PASSWORD_FILE=/root/.restic-pass
restic backup /srv/backups
restic forget --keep-daily 7 --keep-weekly 4 --prune

```

Full walkthrough of that setup in </restic-backup-s3-minio-encrypted/>. If you'd rather keep it dead simple, [rsync to another host](/rsync-backup-linux/) works too — just make sure it lands on different hardware.

## Schedule it with a systemd timer

Skip cron. A systemd timer logs to the journal, won't overlap runs, and catches up if the box was off when it was due:

```ini
# /etc/systemd/system/hytale-backup.service
[Unit]
Description=Hytale world backup

[Service]
Type=oneshot
ExecStart=/usr/local/bin/hytale-backup.sh

```

```ini
# /etc/systemd/system/hytale-backup.timer
[Unit]
Description=Nightly Hytale backup

[Timer]
OnCalendar=*-*-* 03:00:00
Persistent=true

[Install]
WantedBy=timers.target

```

```bash
systemctl daemon-reload
systemctl enable --now hytale-backup.timer
systemctl list-timers hytale-backup.timer

```

`Persistent=true` runs the job on next boot if the machine was asleep at 03:00\. The full timer pattern (and why I dropped cron everywhere) is in </systemd-timers-instead-of-cron/>.

## Auto-restart on crash and on a schedule

Two different problems. **Crash recovery** is just the right directives in the service unit:

```ini
# /etc/systemd/system/hytale.service  (the relevant lines)
[Service]
Restart=on-failure
RestartSec=15
StartLimitIntervalSec=0

```

`Restart=on-failure` brings it back if it dies, `RestartSec=15` waits so you don't hammer a crash loop, and `StartLimitIntervalSec=0` stops systemd from giving up after a few quick restarts.

**Scheduled restart** is the other half. Long-running game servers leak memory and fragment; a daily bounce during dead hours keeps RAM flat and tick rate smooth. Another tiny timer:

```ini
# /etc/systemd/system/hytale-restart.service
[Service]
Type=oneshot
ExecStart=/usr/bin/systemctl restart hytale

```

```ini
# /etc/systemd/system/hytale-restart.timer
[Timer]
OnCalendar=*-*-* 06:00:00
Persistent=true

[Install]
WantedBy=timers.target

```

```bash
systemctl daemon-reload && systemctl enable --now hytale-restart.timer

```

06:00, after the 03:00 backup, before anyone's awake. If your unit uses `KillSignal=SIGINT`/`SIGTERM` with a sane `TimeoutStopSec`, the restart gives the server time to flush the world on its way down.

## Test a restore — or it isn't a backup

The backup you never restored is a guess. Prove it once:

```bash
mkdir -p /tmp/restore-test
tar -xzf /srv/backups/hytale-2026-06-19-0300.tar.gz -C /tmp/restore-test
ls -R /tmp/restore-test/universe | head

```

If you used restic offsite, also pull a snapshot back down and untar it — confirm the bytes survive the round trip, not just the local copy.

## Gotchas

- **Backing up a live world.** Covered above and worth repeating: snapshot while stopped, or accept that some backups will be subtly corrupt. There's no flush-and-pause API you can trust here.
- **Disk fills, server dies.** Old tarballs pile up and one day the partition is full and the server won't start. The `tail -n +8 | xargs rm` prune above plus `restic forget` keeps it bounded. Watch free space.
- **Restart timer vs active players.** A hard 06:00 restart mid-session is rude. Pick your real dead hour, and if you have a global player base, a short in-game "restarting in 60s" broadcast beforehand goes a long way.
- **Early access churn.** Hytale is still moving fast in early access — saves can break across server updates. Take a manual backup *before* every server version bump, not just the nightly one.
- **Secrets in units.** Don't paste your restic password or S3 keys into the `.service` file. Use `EnvironmentFile=` pointing at a root-only `0600` file.

That's the whole maintenance story: clean nightly snapshots, encrypted offsite copy, scheduled restart, crash recovery. Set it once and the server mostly looks after itself.

---

### Related posts

- [Factorio Headless Server on Linux](https://blog.diengdoh.com/factorio-headless-server-linux/?ref=blog.sudowl.com)
- [Rust Dedicated Server on Linux](https://blog.diengdoh.com/rust-dedicated-server-linux/?ref=blog.sudowl.com)
- [7 Days to Die Dedicated Server on Linux](https://blog.diengdoh.com/7-days-to-die-dedicated-server-linux/?ref=blog.sudowl.com)