hopefully fix restore again

master v1.0.1
Bel LaPointe 2020-05-29 08:02:26 -06:00
parent ab0944cbff
commit 604b803f74
1 changed files with 3 additions and 2 deletions

View File

@ -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##*/}"