meskyanichi/backup — Issue #206: Wildcard triggers do not work
Author: joegoggins
Created: 2011-10-26 16:49:58+00:00
State: open

This feature does not work, to replicate, see the following.

With this config:

```ruby
$mysql_config = {
:username => 'bla',
:password => 'bla',
:host => 'bla'
}
Backup::Configuration::Database::MySQL.defaults do |db|
db.username = $mysql_config[:username]
db.password = $mysql_config[:password]
db.host = $mysql_config[:host]
# db.additional_options = ['--quick', '--single-transaction']
end
Backup::Model.new("mysql_a".to_sym, "Backup for db a") do
database MySQL do |db|
db.name = 'a'
end
store_with SCP do |server|
end
end
Backup::Model.new("mysql_b".to_sym, "Backup for db a") do
database MySQL do |db|
db.name = 'b'
end
store_with SCP do |server|
end
end
```

and this command:

backup perform --triggers=mysql_* -c config.rb

You get:

$backup perform --triggers=* -c config.rb
/Users/goggins/.rvm/gems/ruby-1.8.7-p352-i386/gems/backup-3.0.19/lib/backup/finder.rb:76:in `load_config!': /Users/goggins/.rvm/gems/ruby-1.8.7-p352-i386/gems/backup-3.0.19/lib/backup/database/base.rb:21:in `prepare!': uninitialized constant Backup::Database::Base::TRIGGER (NameError)
from /Users/goggins/.rvm/gems/ruby-1.8.7-p352-i386/gems/backup-3.0.19/lib/backup/database/mysql.rb:41:in `initialize'
from /Users/goggins/.rvm/gems/ruby-1.8.7-p352-i386/gems/backup-3.0.19/lib/backup/model.rb:120:in `new'
from /Users/goggins/.rvm/gems/ruby-1.8.7-p352-i386/gems/backup-3.0.19/lib/backup/model.rb:120:in `database'
from (eval):35:in `load_config!'
from /Users/goggins/.rvm/gems/ruby-1.8.7-p352-i386/gems/backup-3.0.19/lib/backup/model.rb:110:in `instance_eval'
from /Users/goggins/.rvm/gems/ruby-1.8.7-p352-i386/gems/backup-3.0.19/lib/backup/model.rb:110:in `initialize'
from (eval):34:in `new'
from (eval):34:in `load_config!'
from /Users/goggins/.rvm/gems/ruby-1.8.7-p352-i386/gems/backup-3.0.19/lib/backup/finder.rb:48:in `matching'
from /Users/goggins/.rvm/gems/ruby-1.8.7-p352-i386/gems/backup-3.0.19/bin/backup:102:in `perform'
from /Users/goggins/.rvm/gems/ruby-1.8.7-p352-i386/gems/backup-3.0.19/bin/backup:100:in `map!'
from /Users/goggins/.rvm/gems/ruby-1.8.7-p352-i386/gems/backup-3.0.19/bin/backup:100:in `perform'
from /Users/goggins/.rvm/gems/ruby-1.8.7-p352-i386/gems/thor-0.14.6/lib/thor/task.rb:22:in `send'
from /Users/goggins/.rvm/gems/ruby-1.8.7-p352-i386/gems/thor-0.14.6/lib/thor/task.rb:22:in `run'
from /Users/goggins/.rvm/gems/ruby-1.8.7-p352-i386/gems/thor-0.14.6/lib/thor/invocation.rb:118:in `invoke_task'
from /Users/goggins/.rvm/gems/ruby-1.8.7-p352-i386/gems/thor-0.14.6/lib/thor.rb:263:in `dispatch'
from /Users/goggins/.rvm/gems/ruby-1.8.7-p352-i386/gems/thor-0.14.6/lib/thor/base.rb:389:in `start'
from /Users/goggins/.rvm/gems/ruby-1.8.7-p352-i386/gems/backup-3.0.19/bin/backup:288
from /Users/goggins/.rvm/gems/ruby-1.8.7-p352-i386/bin/backup:19:in `load'
from /Users/goggins/.rvm/gems/ruby-1.8.7-p352-i386/bin/backup:19

This feature was built in reference to:

https://github.com/meskyanichi/backup/pull/137
https://github.com/meskyanichi/backup/issues/136

I also confirmed the issue manifests agains the current head (5e848a873e9bfabbd8195c1fb53311bb9075c822)