]> git.donarmstrong.com Git - wannabuild.git/blobdiff - trigger.daily
Merge branch 'master' of /org/wanna-build/
[wannabuild.git] / trigger.daily
index 1ee7824dd44ba487915e26d93d1cbab5fad5a4cc..3f9dc1069ac4f472f509ebed85cc7af1e25e8567 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
 
@@ -206,9 +209,6 @@ for a in $ALL_ARCHES ; do
                mv Packages.$d.$a Packages.$d.$a-old
                mv quinn-$d.$a quinn-$d.$a-old
        done
-       if [ "$DAY" = "0" ]; then
-               savelog -p -c 128 /srv/wanna-build/db/$a/transactions.log
-       fi
 done
 umask 022
 for d in $DISTS; do
@@ -216,6 +216,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.
 #