From a081bc5508be7039eac7e13738814df1e4821e3f Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Thu, 22 Jun 2017 09:38:52 +0200 Subject: bin/cleanup new --- bin/cleanup | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 bin/cleanup (limited to 'bin/cleanup') diff --git a/bin/cleanup b/bin/cleanup new file mode 100755 index 0000000..e31dbb3 --- /dev/null +++ b/bin/cleanup @@ -0,0 +1,27 @@ +#!/bin/bash + +# clean up unnecessary data + +. "${0%/*}/../conf/default.conf" + +if ! "${base_dir}/bin/sanity-check" -r; then + >&2 echo 'Build master is not sane.' + exit 1 +fi + +( + ls '/srv/http/build-logs' | \ + sed 's|\.[^.]\+\.build-log\.gz$||' | \ + sort -u + ls "${work_dir}/package-states" | \ + grep '\.broken$\|\.locked$' | \ + sed ' + s|\.[^.]\+$|| + p + ' +) | \ + sort | \ + uniq -u | \ + while read -r s t; do + rm -f "/srv/http/build-logs/${s}."* + done -- cgit v1.2.3-70-g09d2