meskyanichi/backup — Issue #274: Backing up MySQL :all ignores "skip_tables" option
Author: selwin
Created: 2012-02-12 03:58:32+00:00
State: open

Hi there,

mysqldump allows both ``--all-databases`` and ``--ignore-table`` options to be used at the same time but it seems like the current version of backup doesn't process the ``skip_tables`` option if ``db.name = :all`` is used.

Using this config as an example:

```
Backup::Model.new(:my_backup, 'My Backup') do
database MySQL do |db|
# To dump all databases, set db.name = :all (or leave blank)
db.name = :all
db.username = "root"
db.password = ""
db.host = "localhost"
db.port = 3306
db.socket = "/tmp/mysql.sock"
db.skip_tables = ['db.table']
end
end
```

Backup currently generates the following command:

```
/usr/bin/mysqldump --user='root' --host='localhost' --port='3306' --socket='/tmp/mysql.sock' --all-databases > '/Users/selwin/Backup/.tmp/my_backup/databases/MySQL/all-databases.sql
```

While I think the correct command to generate is:

```
/usr/bin/mysqldump --user='root' --host='localhost' --port='3306' --socket='/tmp/mysql.sock' --all-databases --ignore-table=db.exclude > '/Users/selwin/Backup/.tmp/my_backup/databases/MySQL/all-databases.sql
```