aboutsummaryrefslogtreecommitdiff
path: root/extended/checklogs.sh
diff options
context:
space:
mode:
Diffstat (limited to 'extended/checklogs.sh')
-rwxr-xr-xextended/checklogs.sh38
1 files changed, 38 insertions, 0 deletions
diff --git a/extended/checklogs.sh b/extended/checklogs.sh
new file mode 100755
index 0000000..ebd0429
--- /dev/null
+++ b/extended/checklogs.sh
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+## Usage: getlogs.sh [DATE [FORCE]]
+
+proto="http"
+baseurl="autobuild.pure-data.info/auto-build"
+
+#wget_quiet_flags="-q"
+#wget_quiet_flags="-nv"
+wget_quiet_flags=""
+
+logdate="$1"
+test $# -gt 0 && shift
+test -z "$logdate" -o "$logdate" = "-" && logdate=`date +%Y-%m-%d`
+
+if [ $# -gt 0 ]; then
+ force="$1"
+ shift;
+fi
+
+##-- get full log url
+logdir="${baseurl}/${logdate}/logs"
+logurl="${proto}://${logdir}"
+
+##-- get logs
+if [ -d "$logdir" -a "$force" != "force" ]; then
+ echo "$0: logdir $logdir exists and 'force' was not specified"
+ echo "$0: NOT retrieving logs from $logurl"
+else
+ echo "$0: retrieving logs from $logurl to $logdir"
+ wget $wget_quiet_flags -r -np -A ".html,_pd-extended_run-automated-builder.txt" "$logurl/"
+fi
+
+##-- parse logs
+for logfile in ${logdir}/*_pd-extended_*.txt; do
+ #echo "$0: parsing logfile $logfile"
+ ./parselog.perl "$logfile" > "$logfile.moo"
+done