diff options
author | Erich Eckner <git@eckner.net> | 2017-06-22 09:38:52 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2017-06-22 09:38:52 +0200 |
commit | a081bc5508be7039eac7e13738814df1e4821e3f (patch) | |
tree | 81257552a0eb4fe10d2f9ee7a08eba73c147cab6 /bin/cleanup | |
parent | 89854fa2a5367640535935926caf48d1f1c8d5a1 (diff) | |
download | builder-a081bc5508be7039eac7e13738814df1e4821e3f.tar.xz |
bin/cleanup new
Diffstat (limited to 'bin/cleanup')
-rwxr-xr-x | bin/cleanup | 27 |
1 files changed, 27 insertions, 0 deletions
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 |