feat
This commit is contained in:
Guillaume Barreau
2024-01-24 23:35:13 -05:00
parent aaf8ef5231
commit e870520681
6 changed files with 28 additions and 2 deletions

BIN
.DS_Store vendored Normal file

Binary file not shown.

View File

@@ -11,6 +11,16 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
RUN wget -q https://github.com/itzg/rcon-cli/releases/download/1.6.4/rcon-cli_1.6.4_linux_amd64.tar.gz -O - | tar -xz
RUN mv rcon-cli /usr/bin/rcon-cli
RUN rm -f /var/run/crond.pid
RUN apt-get update && apt-get -y install cron
COPY ./scripts/backup.sh /usr/local/bin/backup
RUN chmod +x /usr/local/bin/backup
RUN echo "*/1 * * * * /usr/local/bin/backup\n" > /etc/cron.d/backups-cron
RUN chmod 0644 /etc/cron.d/backups-cron
RUN crontab /etc/cron.d/backups-cron
ENV PORT= \
PUID=1000 \
PGID=1000 \

View File

@@ -1,6 +1,7 @@
services:
palworld:
image: thijsvanloef/palworld-server-docker:latest
image: test/palworld-server-docker:latest
build: .
restart: unless-stopped
container_name: palworld-server
ports:

View File

@@ -1,8 +1,19 @@
#!/bin/bash
printf "\e[0;34m***** RUNNING SCRIPTS backup.sh *****\e[0m\n"
DATE=$(date +"%Y-%m-%d_%H-%M-%S")
FILE_PATH="/palworld/backups/palworld-save-${DATE}.tar.gz"
DESTINATION_PATH="/palworld/backups"
FILE_PATH="${DESTINATION_PATH}/backup_palworld_${DATE}.tar.gz"
if [ ! -f ${FILE_PATH} ]; then
printf "\e[0;32m***** CREATING BACKUPS FOLDER *****\e[0m\n"
mkdir -p "${DESTINATION_PATH}"
fi
cd /palworld/Pal/ || exit
tar -zcf "$FILE_PATH" "Saved/"
echo "backup created at $FILE_PATH"
find "${DESTINATION_PATH}" -type f -name "backup_palworld_*.tar.gz" -ctime +7 -exec rm -f {} \;

View File

@@ -1,5 +1,7 @@
#!/bin/bash
printf "\e[0;34m***** RUNNING SCRIPTS init.sh *****\e[0m\n"
if [[ ! "${PUID}" -eq 0 ]] && [[ ! "${PGID}" -eq 0 ]]; then
printf "\e[0;32m*****EXECUTING USERMOD*****\e[0m\n"
usermod -o -u "${PUID}" steam

View File

@@ -1,5 +1,7 @@
#!/bin/bash
printf "\e[0;34m***** RUNNING SCRIPTS start.sh *****\e[0m\n"
STARTCOMMAND="./PalServer.sh"
if [ -n "${PORT}" ]; then