ensl_hlds/entry.sh
Ari Timonen b7116f85dc Add log rotation
Also fix Makefile
2018-04-18 21:01:53 +00:00

17 lines
450 B
Bash
Executable file
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
function rotateLogs() {
while true; do
cd /home/steam/hlds/ns/logs || exit 1
find . -iname '*.log' -mmin +60 -printf 'Rotated: %p\n' -exec lz4 -z -9 -q "{}" "{}.lz" \;
sleep 300
done
}
if [ -z $ROTATE_LOGS ]; then
which lz4 &>/dev/null || echo "LZ4 not found."
rotateLogs >> /home/steam/hlds/ns/logs/rotate_logs.log &
echo "Rotating logs."
fi
./hlds_run -game ns +maxplayers 32 +log on +map ns_veil +exec ns/server.cfg