From abbb294c4a6f46bb1f326dec6e60f4a95bc3b6dd Mon Sep 17 00:00:00 2001 From: Sebastian <379651+czarly@users.noreply.github.com> Date: Sun, 24 Mar 2024 16:16:04 +0100 Subject: [PATCH] fix --- restore-volumes.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/restore-volumes.sh b/restore-volumes.sh index 4308d22e..3af22e27 100755 --- a/restore-volumes.sh +++ b/restore-volumes.sh @@ -51,11 +51,11 @@ cleanup_folders=() for key in $keys; do volume_name="rpc_$key" - newest_file=$(ls -1 "$backup_dir"/"$volume_name"* 2>/dev/null | sort | tail -n 1) + newest_file=$(ls -1 "$backup_dir"/"${volume_name}"-[0-9]*G.tar.zst 2>/dev/null | sort | tail -n 1) directory="$volume_dir/rpc_$key/_data/" [ -d "$directory" ] && existing_size=$(du -sb "$directory" | awk '{ total += $1 } END { print total }') || existing_size=0 - #echo "$directory: $existing_size" + echo "$directory: $existing_size" if [ -z "$newest_file" ]; then if [[ "$2" = "--print-size-only" && $existing_size -gt 0 ]]; then