From: Joerg Jaspert Date: Sat, 28 Feb 2009 22:46:43 +0000 (+0100) Subject: db X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e8886b409b2824c6dfd2eb806c3a2f59c335642b;p=dak db also export roles. daily dump the dak-dev projectb and recreate it from the postdump. also sync the global stuff from dak to dakdev. Signed-off-by: Joerg Jaspert --- diff --git a/config/debian/cron.dinstall b/config/debian/cron.dinstall index 383ba334..708f49bb 100755 --- a/config/debian/cron.dinstall +++ b/config/debian/cron.dinstall @@ -74,9 +74,20 @@ function pgdump_pre() { function pgdump_post() { log "Creating post-daily-cron-job backup of projectb database..." cd $base/backup - POSTDUMP=$base/backup/dump_$(date +%Y.%m.%d-%H:%M:%S) - pg_dump projectb > $POSTDUMP - ln -sf $POSTDUMP current + POSTDUMP=$(date +%Y.%m.%d-%H:%M:%S) + pg_dump projectb > $base/backup/dump_$POSTDUMP + pg_dumpall --globals-only > $base/backup/dumpall_$POSTDUMP + ln -sf $base/backup/dump_$POSTDUMP current + ln -sf $base/backup/dumpall_$POSTDUMP currentall +} + +# Load the dak-dev projectb +function pgdakdev() { + cd $base/backup + echo "drop database projectb" | psql -p 5433 template1 + cat currentall | psql -p 5433 template1 + createdb -p 5433 -T template0 projectb + fgrep -v '\connect' `cat current` | psql -p 5433 projectb } # Updating various files @@ -663,6 +674,14 @@ GO=( ) stage $GO +GO=( + FUNC="pgdakdev" + TIME="dak-dev db" + ARGS="" + ERR="false" +) +stage $GO + GO=( FUNC="expire" TIME="expire_dumps"