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}