A Bash script to manage a DayZ Server (or multiple) supporting setup, updates, backups, mod/resource management, and optional systemd integration.
- Define reproducable servers from a JSON config file
- Install/update DayZ server via SteamCMD
- Install/update mods from Steam Workshop
- Define resources to be imported from local or remote git repositories
- Define missions to be symlinked into the
mpmissionsfolder - Generate a systemd unit for server management
- Backup mission and profile data with retention policies
- Define a restart policy
Ensure the following are available in your PATH:
jqsteamcmdrealpathfindtarrsyncgit(optional: required for git-based resources)
Usage: dayzmanager.sh [-c config.json] <command>
Options:
-c config.json Path to config file (default: config.json)
-v Enable verbose output
-h Output this message
Command (required):
setup Set up the server
backup Back up files
login Authenticate with remote service
systemd Generate systemd unit file
update Update server and mods
start Start the serverGiven a valid JSON config, use the following steps to setup your DayZ Server.
# Run login to ensure that the specified steam user's (from your JSON config) credentials are cached
dayzmanager.sh -c myconfig.json login# Run setup to install the DayZ Server and the specified mods, resources and missions in your JSON config
dayzmanager.sh -c myconfig.json setup# Run systemd to create or update a systemd unit for starting, stopping, auto-starting at boot, and auto-restarting the DayZ server
dayzmanager.sh -c myconfig.json systemd- login — Authenticate with Steam using credentials in config
- setup — Perform a fresh install using the config
- update — Update the server, mods, and missions
- start — Start the DayZ server with proper signal handling
- backup — Archive profile and mission data
- systemd — Create or update a systemd service unit
This will provide a Namalsk server with backups and auto-restarting every 6 hours.
{
"steam_username": "ExampleUsername",
"install_directory": "~/dayzserver",
"mods": [
{
"name": "Community-Framework",
"item_id": 1559212036
},
{
"name": "Community-Online-Tools",
"item_id": 1564026768
},
{
"name": "Namalsk-Island",
"item_id": 2289456201
},
{
"name": "Namalsk-Survival",
"item_id": 2289461232
}
],
"resources": [
{
"type": "git",
"name": "Namalsk-Server",
"url": "https://github.com/SumrakDZN/Namalsk-Server"
}
],
"missions": [
{
"path": "resources/Namalsk-Server/Mission Files/hardcore.namalsk",
"exclude": [
"storage_1/"
],
"exclude_update": [
"db/messages.xml"
]
}
],
"server_config": "resources/Namalsk-Server/Server Config/Hardcore/serverDZ.cfg",
"start_command": {
"port": 2301,
"additional_flags": [
"cpuCount=4",
"limitFPS=200"
]
},
"systemd": {
"name": "dayz-namalsk-server",
"description": "DayZ Dedicated Namalsk Server",
"restart_after": "6h"
},
"backup": {
"directory": "~/dayzserver-backup",
"prefix": "namalskserver",
"retention_days": 5
}
}MIT