# Respawn (game servers add-on) — every minute.
#
# Runs schedules (restarts with player warnings, backups, broadcasts, commands,
# updates, Rust wipes), notices crashes (Docker restarts the game; this is what
# makes anybody HEAR about it), and samples players/CPU/memory for the graphs.
# With no game servers defined it exits at once and costs nothing.
#
# ⚠️ Guarded on the script: Respawn is an optional add-on. On a box where it is
# not installed this line must be a no-op, not a failure every minute.
# ⚠️ flock -n: a stalled RCON query or a slow `docker stats` can outlast the
# minute; overlapping workers would double-fire schedules.
* * * * * www-data [ -f /var/www/alpha/Addons/respawn/v1.0.0/bin/worker.php ] && /usr/bin/flock -n /run/lock/alpha-respawn.lock /usr/bin/nice -n 10 /usr/bin/php /var/www/alpha/Addons/respawn/v1.0.0/bin/worker.php >/dev/null 2>&1
