From: Evan Broder Date: Thu, 29 Oct 2009 07:40:47 +0000 (-0400) Subject: In xvm-db-backup: X-Git-Tag: 0.0.6^0 X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/xvm-db-backup.git/commitdiff_plain/b339df145288bcbc12b68a20fcec078f0b96bf60?hp=1e297568c0d959c4159cdf9789bde1843f4cd92c In xvm-db-backup: * Let the config file specify a list of tables to exclude from the backup. svn path=/trunk/packages/xvm-db-backup/; revision=2536 --- diff --git a/debian/changelog b/debian/changelog index 433d147..a07ed35 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 Mon, 26 Oct 2009 10:14:47 -0400 + xvm-db-backup (0.0.5) unstable; urgency=low * Fix a typo in the updated script. diff --git a/xvm-db-backup b/xvm-db-backup index baec673..5c93095 100755 --- a/xvm-db-backup +++ b/xvm-db-backup @@ -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)"