]> git.decadent.org.uk Git - dak.git/commitdiff
db
authorJoerg Jaspert <joerg@debian.org>
Sat, 28 Feb 2009 22:46:43 +0000 (23:46 +0100)
committerJoerg Jaspert <joerg@debian.org>
Sat, 28 Feb 2009 22:46:43 +0000 (23:46 +0100)
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 <joerg@debian.org>
config/debian/cron.dinstall

index 383ba3346aaa4f3a32dec93b8c7270a6eded8a17..708f49bb9c206506652ffe5e5ed9d380eae04dd8 100755 (executable)
@@ -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"