Commits

Anonymous committed e0902f4

Adding slave cleaning script

  • Participants
  • Parent commits aecb126

Comments (0)

Files changed (1)

slave/usr/local/bin/slave-cleaner.sh

+#!/bin/bash
+
+CONF=/etc/vlbuildslave/slavehost.conf
+
+source $CONF || exit 1
+
+for rel in $VLVERSIONS; do
+	jaildir=${CHROOTS[$rel]}
+	cd $jaildir || exit 1
+	echo "$(date) Cleaning up $jaildir"
+	for junk in $(ls | grep -v CHROOT-RO); do
+		inmount=$(mount | grep $junk)
+		junkpath=${jaildir}/${junk}
+		if [ "x$inmount" == "x" ]; then
+			rm -rf $junkpath
+#			echo "$junkpath can be removed"
+		else
+			echo "$junkpath is in use"
+		fi
+	done
+
+done