Merge branch 'main' into cron-backup

This commit is contained in:
Carlos M. Martinez
2024-01-28 13:38:11 -05:00
30 changed files with 1598 additions and 218 deletions

View File

@@ -1,5 +1,9 @@
#!/bin/bash
if [ "${RCON_ENABLED}" = true ]; then
rcon-cli save
fi
DATE=$(date +"%Y-%m-%d_%H-%M-%S")
DESTINATION_PATH="/palworld/backups"
FILE_PATH="${DESTINATION_PATH}/backup_palworld_${DATE}.tar.gz"
@@ -12,6 +16,11 @@ fi
cd /palworld/Pal/ || exit
tar -zcf "$FILE_PATH" "Saved/"
if [ "$(id -u)" -eq 0 ]; then
chown steam:steam "$FILE_PATH"
fi
echo "backup created at $FILE_PATH"
if [[ -n "${DAYS_TO_KEEP}" && "${DAYS_TO_KEEP}" =~ ^[0-9]+$ ]]; then