Skip to content

Commit

Permalink
Merge pull request #623 from Dashboy1998/Updated-restore-for-0.2.0.6+
Browse files Browse the repository at this point in the history
Updated restore.sh to move Palworld backup folder during restore
  • Loading branch information
thijsvanloef authored Nov 17, 2024
2 parents bbdc391 + 27952f8 commit 4a7eebc
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions scripts/restore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,19 @@ if [ -f "$BACKUP_FILE" ]; then
# Decompress the backup file in tmp directory
tar -zxvf "$BACKUP_FILE" -C "$TMP_PATH"

# Find backup folders
mapfile -t backup_folders < <(find "$RESTORE_PATH" -name "backup" -type d | sed "s|^$RESTORE_PATH||")

# Check if backup folder parents exist in restore
for backup_folder in "${backup_folders[@]}"
do
backup_folder_dirname=$( dirname "$backup_folder" )
if [ -d "$TMP_PATH/$backup_folder_dirname" ]; then
# Move backup folder into restore
mv "$RESTORE_PATH/$backup_folder_dirname/backup" "$TMP_PATH/$backup_folder_dirname"
fi
done

# Make sure Saves with a different ID are removed before restoring the save
rm -rf "$RESTORE_PATH/Saved/"

Expand Down

0 comments on commit 4a7eebc

Please sign in to comment.