From 604b803f74efb8145f2cf029e8c5ac76f58ae434 Mon Sep 17 00:00:00 2001 From: Bel LaPointe Date: Fri, 29 May 2020 08:02:26 -0600 Subject: [PATCH] hopefully fix restore again --- restore.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/restore.sh b/restore.sh index 243c384..da528ee 100755 --- a/restore.sh +++ b/restore.sh @@ -1,6 +1,7 @@ -for b in $(find /mnt/save -type f | sort | tail -n 1); do +for b in $(find /mnt/save -not -path '*/\.*' -type f | sort -r); do if [ -n "$b" ]; then - if du -sh "$b" | grep -Ei "^[ ]*(4|2[0-9])(.0)?[Kk]"; then + du -sh "$b" + if ! du -sh "$b" | grep -Ei "^[ \t]*[0-9][0-9]?(.0)?[mg]"; then echo would rm empty backup $b >&2 set -x mv "$b" "${b%/*}/.${b##*/}"