From 40ebafc2335dbe2153a461fe5ccf73a025d9e1f8 Mon Sep 17 00:00:00 2001 From: Markus Ressel Date: Fri, 31 Jul 2020 16:09:45 +0200 Subject: [PATCH] ignore file if missing on disk (#5) --- zfs-inplace-rebalancing.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/zfs-inplace-rebalancing.sh b/zfs-inplace-rebalancing.sh index 2e52bc3..bf41d75 100755 --- a/zfs-inplace-rebalancing.sh +++ b/zfs-inplace-rebalancing.sh @@ -60,6 +60,10 @@ function rebalance () { progress_percent=$(echo "scale=2; ${current_index}*100/${file_count}" | bc) color_echo "${Cyan}" "Progress -- Files: ${current_index}/${file_count} (${progress_percent}%)" + if [[ ! -f "${file_path}" ]]; then + color_echo "${Yellow}" "File is missing, skipping: ${file_path}" + fi + if [ "${passes_flag}" -ge 1 ]; then # check if target rebalance count is reached rebalance_count=$(get_rebalance_count "${file_path}")