Skip to content

Commit

Permalink
Added waiting for backups to complete before stopping
Browse files Browse the repository at this point in the history
  • Loading branch information
Dashboy1998 committed Feb 1, 2024
1 parent 689674b commit 267560e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions scripts/backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ DATE=$(date +"%Y-%m-%d_%H-%M-%S")
FILE_PATH="/palworld/backups/palworld-save-${DATE}.tar.gz"
cd /palworld/Pal/ || exit

echo "Creating backup"
tar -zcf "$FILE_PATH" "Saved/"

if [ "$(id -u)" -eq 0 ]; then
Expand Down
6 changes: 6 additions & 0 deletions scripts/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,9 @@ su steam -c ./start.sh &
# Process ID of su
killpid="$!"
wait $killpid

echo "Waiting for backup to finish"
backup_pids=($(pgrep backup))
for pid in "${backup_pids[@]}"; do
tail --pid=$pid -f 2>/dev/null
done

0 comments on commit 267560e

Please sign in to comment.