summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Levsen <holger@layer-acht.org>2015-02-16 10:36:11 +0100
committerHolger Levsen <holger@layer-acht.org>2015-02-16 10:36:11 +0100
commitcd02e6e9dfa2a6fad2e66cd46dcf2a8bbfbf8f31 (patch)
treeecd2d547f367709df1e4a2268560903a0a64841d
parent74e17defe29f300aa3e3c4d8e562536665121b8c (diff)
downloadjenkins.debian.net-cd02e6e9dfa2a6fad2e66cd46dcf2a8bbfbf8f31.tar.xz
add rebootstrap_maintaince job to delete log_content.html files older than a week
-rwxr-xr-xbin/maintainance.sh15
-rw-r--r--job-cfg/self.yaml6
2 files changed, 20 insertions, 1 deletions
diff --git a/bin/maintainance.sh b/bin/maintainance.sh
index e5a95265..e5e61ed1 100755
--- a/bin/maintainance.sh
+++ b/bin/maintainance.sh
@@ -1,6 +1,6 @@
#!/bin/bash
-# Copyright 2012-2014 Holger Levsen <holger@layer-acht.org>
+# Copyright 2012-2015 Holger Levsen <holger@layer-acht.org>
# released under the GPLv=2
DEBUG=false
@@ -34,6 +34,17 @@ chroot_checks() {
echo "WARNING: should remove directories in /(s)chroots which are older than a month."
}
+remove_old_rebootstrap_logs() {
+ # find and warn about old temp directories
+ OLDSTUFF=$(find /var/lib/jenkins/jobs/rebootstrap_* -maxdepth 0 -mtime +7 -name log_content.html -exec rm -v {} \;)
+ fi
+ if [ ! -z "$OLDSTUFF" ] ; then
+ echo "Old html logs have been deleted:"
+ echo "$OLDSTUFF"
+ fi
+}
+
+
report_old_directories() {
# find and warn about old temp directories
if [ -z "$3" ] ; then
@@ -171,6 +182,8 @@ else
;;
squid) report_squid_usage
;;
+ rebootstrap) remove_old_rebootstrap_logs
+ ;;
*) ;;
esac
fi
diff --git a/job-cfg/self.yaml b/job-cfg/self.yaml
index 83335ee4..55967cd3 100644
--- a/job-cfg/self.yaml
+++ b/job-cfg/self.yaml
@@ -40,7 +40,11 @@
- job-template:
defaults: self-maintainance
+ name: '{name}_sub-maintainance'
+ defaults: self-maintainance
name: '{name}_sub-maintainance-squid'
+ defaults: self-maintainance
+ name: 'rebootstrap_maintainance'
- project:
name: self
@@ -50,4 +54,6 @@
my_shell: '/srv/jenkins/bin/maintainance.sh'
- '{name}_sub-maintainance-squid':
my_shell: '/srv/jenkins/bin/maintainance.sh squid'
+ - 'rebootstrap_maintainance':
+ my_shell: '/srv/jenkins/bin/maintainance.sh rebootstrap'