]> git.donarmstrong.com Git - wannabuild.git/blobdiff - trigger.daily
Expire old dump files.
[wannabuild.git] / trigger.daily
index 1ee7824dd44ba487915e26d93d1cbab5fad5a4cc..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
 
@@ -216,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.
 #