}
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
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
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
- wanna-build --remove-maintenance-lock --database=$a/build-db
done
umask 022
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.
#