From d28cada0d55823fdcc5860c7cfceccf93b62e2cd Mon Sep 17 00:00:00 2001
From: "Hahn Axel (hahn)" <axel.hahn@unibe.ch>
Date: Thu, 1 Feb 2024 17:18:14 +0100
Subject: [PATCH] show stats

---
 rest_pruner.sh | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/rest_pruner.sh b/rest_pruner.sh
index 37cae6a..491c108 100755
--- a/rest_pruner.sh
+++ b/rest_pruner.sh
@@ -19,7 +19,7 @@ bOptDebug=0
 typeset -i iCountDirs=0
 typeset -i iCountMatch=0
 typeset -i iCountPrune=0
-
+typeset -i iCountPruneError=0
 
 typeset -i rcAll=0
 
@@ -104,7 +104,9 @@ function _prune(){
                     echo END $( date ) exitcode $rc | tee -a "${logfile}.running"
                     if [ "$rc" -eq "0" ]; then
                             mv "${logfile}.running" "${logfile}"
+                            iCountPrune+=1
                     else
+                            iCountPruneError+=1
                             mv "${logfile}.running" "${logfile}.error"
                     fi
                 fi
@@ -195,6 +197,13 @@ do
         _prune "${mydir}"
 done
 
+echo
+echo "Status:"
+echo "Directories: $iCountDirs"
+echo "Matching   : $iCountMatch"
+echo "Pruned     : $iCountPrune"
+echo "Prune erors: $iCountPruneError"
+echo
 
 echo "done - exitcode $rcAll"
 exit $rcAll
-- 
GitLab