Remember to replace the folder directory, <AdminPassword>
, <RCONPort>
to your own.
Also, you need to use crontab
to schedule the following scripts if necessary.
I'm using supervisor to restart the service, the example config is as:
[program:pal]
command="/home/steam/.local/share/Steam/steamapps/common/PalServer/Pal/Binaries/Linux/PalServer-Linux-Test" Pal -useperfthreads -NoAsyncLoadingThread -UseMultithreadForDS
numprocs=1
process_name=pal-%(process_num)d
directory=/home/steam/.local/share/Steam/steamapps/common/PalServer
user=steam
environment=HOME="/home/steam",USER="steam"
autostart=true
autorestart=true
stdout_logfile=/var/log/supervisor/pal.out
stderr_logfile=/var/log/supervisor/pal.err
#!/bin/sh
DDATE=`date "+%F-%T"`
mkdir $DDATE
cp -r /home/steam/steamapps/common/PalServer/Pal/Saved/SaveGames $DDATE/
Need to:
#!/bin/sh
RCON_PORT=<RCONPort>
ADMIN_PASSWORD=<AdminPassword>
echo 'broadcast Auto_Reboot_Initialized' | ./ARRCON -P $RCON_PORT -p $ADMIN_PASSWORD
echo 'save' | ./ARRCON -P $RCON_PORT -p $ADMIN_PASSWORD
echo "shutdown 300 Server_is_going_to_reboot_in_5_minutes" | ./ARRCON -P $RCON_PORT -p $ADMIN_PASSWORD
sleep 120
echo 'broadcast Server_is_going_to_reboot_in_3_minutes' | ./ARRCON -P $RCON_PORT -p $ADMIN_PASSWORD
sleep 60
echo 'broadcast Server_is_going_to_reboot_in_2_minutes' | ./ARRCON -P $RCON_PORT -p $ADMIN_PASSWORD
sleep 60
echo 'broadcast Server_is_going_to_reboot_in_60_seconds' | ./ARRCON -P $RCON_PORT -p $ADMIN_PASSWORD
sleep 50
echo 'broadcast Server_is_going_to_reboot_in_10_seconds' | ./ARRCON -P $RCON_PORT -p $ADMIN_PASSWORD
sleep 5
echo 'broadcast Server_is_going_to_reboot_in_5_seconds' | ./ARRCON -P $RCON_PORT -p $ADMIN_PASSWORD
sleep 1
echo 'broadcast Server_is_going_to_reboot_in_4_seconds' | ./ARRCON -P $RCON_PORT -p $ADMIN_PASSWORD
sleep 1
echo 'broadcast Server_is_going_to_reboot_in_3_seconds' | ./ARRCON -P $RCON_PORT -p $ADMIN_PASSWORD
sleep 1
echo 'broadcast Server_is_going_to_reboot_in_2_seconds' | ./ARRCON -P $RCON_PORT -p $ADMIN_PASSWORD
sleep 1
echo 'broadcast Server_is_going_to_reboot_in_1_second' | ./ARRCON -P $RCON_PORT -p $ADMIN_PASSWORD
Need to install bc
by apt install bc
.
#!/bin/bash
RCON_PORT=<RCONPort>
ADMIN_PASSWORD=<AdminPassword>
THRESHOLD=80
MEMORY_USAGE=$(free | grep Mem | awk '{print $3/$2 * 100.0}')
if (( $(echo "$MEMORY_USAGE > $THRESHOLD" | bc -l) )); then
echo "Memory usage is above $THRESHOLD%. Running clean command."
echo "broadcast Memory_Is_Above_$THRESHOLD%" | ./ARRCON -P $RCON_PORT -p $ADMIN_PASSWORD
echo "save" | ./ARRCON -P $RCON_PORT -p $ADMIN_PASSWORD
echo "shutdown 60 Reboot_In_60_Seconds" | ./ARRCON -P $RCON_PORT -p $ADMIN_PASSWORD
cd ~/backups ; ./backup.sh
else
echo "Memory usage is below $THRESHOLD%. No action required."
fi
- Exiting the guild will cause all players who was not logged-in at the moment to corrupt their save files! (Joining another guild will exit the old one as well.) Next time they log in they'll stuck at the loading spinning black screen. You can either clean the save files of those who got corrupted or restore a backup. Now fixable by https://gist.github.com/Bluefissure/f277a3409cdaf09cddbad5983fd01f68
You can also check my new project that generates the server configuration file in a friendly way! https://github.com/Bluefissure/pal-conf