summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2010-01-05 10:35:16 -0500
committerStephen Gallagher <sgallagh@redhat.com>2010-01-05 10:35:16 -0500
commitb9aad37c65b7c9c0bd4f6c1ef1a26f2c9dc3db29 (patch)
tree6d32a3e950961db04a359dab1ca673ae1b932bb6
parentf229513c677f6a3f702ddeb785a3fbbcfb2d60dc (diff)
downloadbuild_tools-b9aad37c65b7c9c0bd4f6c1ef1a26f2c9dc3db29.zip
build_tools-b9aad37c65b7c9c0bd4f6c1ef1a26f2c9dc3db29.tar.gz
build_tools-b9aad37c65b7c9c0bd4f6c1ef1a26f2c9dc3db29.tar.xz
Only clean up RPMs and logs after a successful build
-rwxr-xr-xsssd-nightly.sh16
1 files changed, 8 insertions, 8 deletions
diff --git a/sssd-nightly.sh b/sssd-nightly.sh
index 79a85e4..bbb100f 100755
--- a/sssd-nightly.sh
+++ b/sssd-nightly.sh
@@ -51,14 +51,6 @@ LOGFILE=/local/sgallagh/logs/nightly-$datestamp.log
echo "===== BUILD STARTED AT `date` =====" >> $LOGFILE
-echo "===== Cleaning old logs =====" >> $LOGFILE
-find /local/sgallagh/logs -type f -daystart -ctime +6 -name "nightly-*.log" -exec rm -f {} \; || finish 40
-
-echo "===== Cleaning old RPMS =====" >> $LOGFILE
-find /local/sgallagh/repos/f11 -type f -daystart -ctime +6 -name "sssd-*" -exec rm -f {} \; || finish 50
-find /local/sgallagh/repos/f12 -type f -daystart -ctime +6 -name "sssd-*" -exec rm -f {} \; || finish 51
-find /local/sgallagh/repos/rhel5 -type f -daystart -ctime +6 -name "sssd-*" -exec rm -f {} \; || finish 52
-
echo "===== CHECKING OUT CODE =====" >> $LOGFILE
rm -Rf sssd-$datestamp #Remove an incomplete previous run
git clone $git_repo sssd-$datestamp >> $LOGFILE 2>&1
@@ -313,6 +305,14 @@ if [ x$scratch_build == x ]; then
echo $commit_id > /local/sgallagh/.commit
fi
+echo "===== Cleaning old logs =====" >> $LOGFILE
+find /local/sgallagh/logs -type f -daystart -ctime +6 -name "nightly-*.log" -exec rm -f {} \;
+
+echo "===== Cleaning old RPMS =====" >> $LOGFILE
+find /local/sgallagh/repos/f11 -type f -daystart -ctime +6 -name "sssd-*" -exec rm -f {} \;
+find /local/sgallagh/repos/f12 -type f -daystart -ctime +6 -name "sssd-*" -exec rm -f {} \;
+find /local/sgallagh/repos/rhel5 -type f -daystart -ctime +6 -name "sssd-*" -exec rm -f {} \;
+
echo "===== BUILD CONCLUDED AT `date` =====" >> $LOGFILE
finish 0