Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated restore.sh to move Palworld backup folder during restore #623

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading