Last change
on this file since 2728 was
2536,
checked in by broder, 15 years ago
|
In xvm-db-backup:
- Let the config file specify a list of tables to exclude from the
backup.
|
-
Property svn:executable set to
*
|
File size:
779 bytes
|
Rev | Line | |
---|
[1656] | 1 | #!/bin/bash |
---|
| 2 | |
---|
| 3 | set -e |
---|
| 4 | |
---|
| 5 | kinit -k "daemon/$(hostname -f)" |
---|
| 6 | aklog sipb |
---|
| 7 | |
---|
[2257] | 8 | db_filename="/mit/xvm/backups/db/prod/$(date +%Y/%m/%d.%H%M.sql.gz)" |
---|
[2254] | 9 | mkdir -p "$(dirname $db_filename)" |
---|
[1656] | 10 | |
---|
[2536] | 11 | exclude=() |
---|
| 12 | if invirt-getconf db.backup_exclude &>/dev/null; then |
---|
| 13 | for i in invirt-getconf -l db.backup_exclude; do |
---|
| 14 | exclude=("${exclude[@]}" -T "$(invirt-getconf "db.backup_exclude.$i")") |
---|
| 15 | done |
---|
| 16 | fi |
---|
[1656] | 17 | /usr/bin/pg_dump -U "$(invirt-getconf db.user)" \ |
---|
| 18 | -h "$(invirt-getconf db.host)" \ |
---|
[2536] | 19 | "${exclude[@]}" \ |
---|
[1711] | 20 | "$(invirt-getconf db.dbname)" | gzip - >"$db_filename" |
---|
| 21 | |
---|
[2257] | 22 | running_filename="/mit/xvm/log/running/prod/$(date +%Y/%m/%d.%H%M.gz)" |
---|
[2259] | 23 | mkdir -p "$(dirname $running_filename)" |
---|
[1711] | 24 | |
---|
| 25 | remctl "$(invirt-getconf remote.hostname)" web listvms | gzip - >"$running_filename" |
---|
Note: See
TracBrowser
for help on using the repository browser.