In xvm-db-backup: 0.0.6
authorEvan Broder <broder@mit.edu>
Thu, 29 Oct 2009 07:40:47 +0000 (03:40 -0400)
committerEvan Broder <broder@mit.edu>
Thu, 29 Oct 2009 07:40:47 +0000 (03:40 -0400)
  * Let the config file specify a list of tables to exclude from the
    backup.

svn path=/trunk/packages/xvm-db-backup/; revision=2536

debian/changelog
xvm-db-backup

index 433d147..a07ed35 100644 (file)
@@ -1,3 +1,10 @@
+xvm-db-backup (0.0.6) unstable; urgency=low
+
+  * Let the config file specify a list of tables to exclude from the
+    backup.
+
+ -- Evan Broder <broder@mit.edu>  Mon, 26 Oct 2009 10:14:47 -0400
+
 xvm-db-backup (0.0.5) unstable; urgency=low
 
   * Fix a typo in the updated script.
index baec673..5c93095 100755 (executable)
@@ -8,8 +8,15 @@ aklog sipb
 db_filename="/mit/xvm/backups/db/prod/$(date +%Y/%m/%d.%H%M.sql.gz)"
 mkdir -p "$(dirname $db_filename)"
 
+exclude=()
+if invirt-getconf db.backup_exclude &>/dev/null; then
+    for i in invirt-getconf -l db.backup_exclude; do
+       exclude=("${exclude[@]}" -T "$(invirt-getconf "db.backup_exclude.$i")")
+    done
+fi
 /usr/bin/pg_dump -U "$(invirt-getconf db.user)" \
                  -h "$(invirt-getconf db.host)" \
+                 "${exclude[@]}" \
                  "$(invirt-getconf db.dbname)" | gzip - >"$db_filename"
 
 running_filename="/mit/xvm/log/running/prod/$(date +%Y/%m/%d.%H%M.gz)"