[Piuparts-commits] [SCM] piatti.debian.org configuration files branch, piatti, updated. 8b4c27e67488c8ae80f368affd2907ca99358352

Andreas Beckmann debian at abeckmann.de
Tue Dec 6 21:47:24 UTC 2011


The following commit has been merged in the piatti branch:
commit 8b4c27e67488c8ae80f368affd2907ca99358352
Author: Andreas Beckmann <debian at abeckmann.de>
Date:   Tue Dec 6 17:26:16 2011 +0100

    incrementally archive old logs
    
    only look at logs that changed since the last archiving run to
    determine the packages to check - no need to look at 30000+
    unchanged packages from stable every day
    (actually also look at logs up to one day older to avoid races)
    
    Signed-off-by: Andreas Beckmann <debian at abeckmann.de>

diff --git a/home/piupartsm/bin/archive_old_logs b/home/piupartsm/bin/archive_old_logs
index b60175b..ad6d9aa 100755
--- a/home/piupartsm/bin/archive_old_logs
+++ b/home/piupartsm/bin/archive_old_logs
@@ -48,8 +48,10 @@ for SECTION in $SECTIONS ; do
 	mkdir -p $MASTER/$SECTION/archive
 	cd $MASTER/$SECTION
 	mkdir -p archive/pass archive/bugged archive/fail
+	test -f archive/stamp || touch -d @0 archive/stamp  # start at the epoch
+	touch -d yesterday archive/stamp.new  # look back one more day the next time we will be run
 	# loop through all packages logs 
-	for PACKAGE in $(find pass/ fail/ bugged/ -name '*.log' | cut -d"_" -f1 | cut -d"/" -f2 | sort -u) ; do
+	for PACKAGE in $(find pass/ fail/ bugged/ -name '*.log' -newer archive/stamp | cut -d"_" -f1 | cut -d"/" -f2 | sort -u) ; do
 		# all logs except the last one (|sed '$d' deletes the last line)
 		OLDLOGS=$( ls -tr1 --color=none bugged/${PACKAGE}_*.log fail/${PACKAGE}_*.log pass/${PACKAGE}_*.log 2>/dev/null|sed '$d' )
 		if [ ! -z "$OLDLOGS" ] ; then
@@ -65,5 +67,6 @@ for SECTION in $SECTIONS ; do
 	done
 	echo
 	echo
+	mv archive/stamp.new archive/stamp
 done
 

-- 
piatti.debian.org configuration files



More information about the Piuparts-commits mailing list