[Piuparts-commits] [SCM] piuparts git repository branch, develop, updated. 0.44-827-g219614b
Andreas Beckmann
debian at abeckmann.de
Wed Jun 20 23:09:54 UTC 2012
The following commit has been merged in the develop branch:
commit 52e1c4d4182ef55771d7245b35b2e52a049961b4
Author: Andreas Beckmann <debian at abeckmann.de>
Date: Wed Jun 20 19:42:21 2012 +0200
reschedule_oldest_logs: print total count over all sections
Signed-off-by: Andreas Beckmann <debian at abeckmann.de>
diff --git a/home/piupartsm/bin/reschedule_oldest_logs b/home/piupartsm/bin/reschedule_oldest_logs
index 3dfaaf6..f3c163a 100755
--- a/home/piupartsm/bin/reschedule_oldest_logs
+++ b/home/piupartsm/bin/reschedule_oldest_logs
@@ -48,6 +48,7 @@ get_config_value COUNT global reschedule-old-count 200
get_config_value FAIL_AGE global reschedule-fail-days 30
get_config_value FAIL_COUNT global reschedule-fail-count 25
+TOTAL=0
LOGS=`mktemp`
OLDPWD=$(pwd)
for SECTION in $SECTIONS ; do
@@ -62,7 +63,9 @@ for SECTION in $SECTIONS ; do
find pass fail affected -name "*.log" -mtime +$_AGE | xargs --no-run-if-empty -n99999 -s999999 ls -dt | tail -n $_COUNT > $LOGS
find fail affected -name "*.log" -mtime +$_FAIL_AGE | xargs --no-run-if-empty -n99999 -s999999 ls -dt | tail -n $_FAIL_COUNT >> $LOGS
if [ -s $LOGS ]; then
- echo $SECTION: $(wc -l $LOGS | awk '{ print $1 }')
+ COUNT=$(wc -l $LOGS | awk '{ print $1 }')
+ TOTAL=$(($TOTAL + $COUNT))
+ echo "$SECTION: $COUNT"
ls -dtl $(cat $LOGS)
sort -u $LOGS | xargs rm 2>/dev/null
echo
@@ -73,3 +76,7 @@ for SECTION in $SECTIONS ; do
fi
done
rm $LOGS
+
+if [ "$TOTAL" -gt "0" ]; then
+ echo "Rescheduled $TOTAL logs"
+fi
--
piuparts git repository
More information about the Piuparts-commits
mailing list