From f39159385734bf5e5af2818b5492242d818a4a9b Mon Sep 17 00:00:00 2001 From: Oleg Sheynin Date: Fri, 19 Jul 2024 11:04:30 -0400 Subject: [PATCH] progress --- release_version.txt | 2 +- utils/prune_data.sh | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/release_version.txt b/release_version.txt index 85b7c69..c81aa44 100644 --- a/release_version.txt +++ b/release_version.txt @@ -1 +1 @@ -0.9.6 +0.9.7 diff --git a/utils/prune_data.sh b/utils/prune_data.sh index caaa84c..b355a83 100755 --- a/utils/prune_data.sh +++ b/utils/prune_data.sh @@ -3,14 +3,14 @@ Src=${1} Days=${2} -if [ "${Src}" == "" ] -then - echo "Usage: $0 []" +if [ -z "$Days" ] || [ -z "$Src" ]; then + echo "Usage: $0 " exit 1 fi -if [ "${Days}" == "" ] -then - Days=30 + +# Add / if Src does not have it (symlinks) +if [ "${Src: -1}" != "/" ]; then + Src="${Src}/" fi declare -A Settings=() @@ -25,9 +25,9 @@ echo "Finding files older than ${prune_date}..." Cmd="find ${src} -type f ! -newermt \"${prune_date}\"" echo ${Cmd} files=($(eval ${Cmd})) -total_files= ${#files[*]} +total_files=${#files[*]} -if [[ ${total} == 0 ]] +if [[ ${total_files} == 0 ]] then echo "No files found to be pruned. Bye..." exit 0 @@ -38,7 +38,7 @@ duf ${src} echo "The following files will be removed:" echo "====================================" -for f in $files ; do echo $f; done +for f in $files ; do ls -l $f; done echo "====================================" echo "Total files to be pruned: ${total_files}"