cleanup
[infrastructure.git] / scripts / trash / trash-failed-builds.sh
diff --git a/scripts/trash/trash-failed-builds.sh b/scripts/trash/trash-failed-builds.sh
new file mode 100755 (executable)
index 0000000..95656ff
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+function myecho () { [ -n "$DEBUG" ] && echo "$@" ; }
+
+[[ -d $1 ]] && { cd $1; myecho "cwd now is $(pwd)"; shift; }
+
+for ko in $(ls -1 *.log.txt.ko 2> /dev/null) ; do 
+    base=$(basename $ko .log.txt.ko)
+    myecho "============== $base (from $ko)"
+    for f in $base $base.log.txt $ko ; do
+       [ -e $f ] && { myecho "Trashing $f" ; mv $f /build/trash ; }
+    done
+done