]> git.donarmstrong.com Git - wannabuild.git/blobdiff - trigger.daily
Add space so that the sql statement looks nicer.
[wannabuild.git] / trigger.daily
index 2d4380621918f65aed3f80e4aca71c870354af6f..0926de133362ae03a5b6b56624dc1c57f8160ba0 100755 (executable)
@@ -38,6 +38,9 @@ cleanup() {
 }
 trap cleanup 0
 
+echo Dumping wanna-build databases...
+sudo -u postgres /usr/bin/pg_dumpall --cluster 8.4/wanna-build | bzip2 > /org/wanna-build/dumps/dump_pre_$(date +%Y.%m.%d-%H:%M:%S).bz2
+
 echo Updating wanna-build databases...
 umask 027
 
@@ -170,8 +173,6 @@ umask 002
 ALL_ARCHES=$(echo $ARCHS_oldstable $ARCHS_stable $ARCHS_testing $ARCHS_unstable \
             | tr ' ' '\n' | sort -u)
 for a in $ALL_ARCHES ; do
-       wanna-build --create-maintenance-lock --database=$a/build-db
-
        for d in $DISTS ; do
                dist=`echo $d | sed s/-.*$//`
                case "$dist" in
@@ -211,7 +212,6 @@ for a in $ALL_ARCHES ; do
        if [ "$DAY" = "0" ]; then
                savelog -p -c 128 /srv/wanna-build/db/$a/transactions.log
        fi
-       wanna-build --remove-maintenance-lock --database=$a/build-db
 done
 umask 022
 for d in $DISTS; do
@@ -219,6 +219,11 @@ for d in $DISTS; do
 done
 
 echo "merge ended: `date`"
+
+sudo -u postgres /usr/bin/pg_dumpall --cluster 8.4/wanna-build | bzip2 > /org/wanna-build/dumps/dump_post_$(date +%Y.%m.%d-%H:%M:%S).bz2
+
+(cd /org/wanna-build/dumps && /org/wanna-build/expire_dumps -d . -f "dump_*")
+
 #
 # Only update stats if it's been at least 20h since the last time.
 #