From 108ae35a067ea4d74b703822db2e15dab0c852c9 Mon Sep 17 00:00:00 2001 From: Oleg Sheynin Date: Fri, 19 Jul 2024 10:45:46 -0400 Subject: [PATCH] progress --- release_version.txt | 2 +- utils/prune_data.sh | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/release_version.txt b/release_version.txt index b0bb878..85b7c69 100644 --- a/release_version.txt +++ b/release_version.txt @@ -1 +1 @@ -0.9.5 +0.9.6 diff --git a/utils/prune_data.sh b/utils/prune_data.sh index 977d07d..caaa84c 100755 --- a/utils/prune_data.sh +++ b/utils/prune_data.sh @@ -20,18 +20,27 @@ Settings[PruneDate]=$(date -d "${Days} days ago" '+%Y-%m-%d') src=${Settings[Src]} prune_date=${Settings[PruneDate]} -echo Before Pruning.... -duf ${src} echo "Finding files older than ${prune_date}..." Cmd="find ${src} -type f ! -newermt \"${prune_date}\"" echo ${Cmd} files=($(eval ${Cmd})) +total_files= ${#files[*]} + +if [[ ${total} == 0 ]] +then + echo "No files found to be pruned. Bye..." + exit 0 +fi + +echo Before Pruning.... +duf ${src} + echo "The following files will be removed:" echo "====================================" for f in $files ; do echo $f; done echo "====================================" -echo "Total files to be pruned: ${#files[*]}" +echo "Total files to be pruned: ${total_files}" Cmd="${Cmd} -delete" echo ${Cmd}