From edf0a642539babdccb220d0c46b7c0eec52a0692 Mon Sep 17 00:00:00 2001 From: Patrick McGuire Date: Wed, 13 Oct 2021 17:23:23 -0400 Subject: [PATCH] this is already a lot better --- scripts/cleanup.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/cleanup.sh b/scripts/cleanup.sh index 0b922d6..498f9c4 100755 --- a/scripts/cleanup.sh +++ b/scripts/cleanup.sh @@ -7,3 +7,8 @@ for i in "${empties[@]}";do rm -f "${i}" rm -f "${i/.csv/}" done + +if [[ "$(find ${PROCESSED} | wc -l)" -ge 100 ]];then + ls -1t . | tail -n +100 | xargs -r rm -vv +else +