Sometimes you need to do some tricky things to put your system into a proper state for backup. This patch adds hooks for scripting these setup and teardown tasks right in your model's config.
More specifically, it adds these DSL methods:
Backup::Model.new(:test_backup, 'back up procedure with before/after hooks') do
before do |model|
# a ruby block for setup
after do |model|
# a ruby block for teardown
# the rest of your configuraiton
These hooks will be called right after logging the 'backup started' message and right before the 'backup finished' message.
Each hook also logs its own start, finish, or error messages.
omit -pass option in decrypt command if --password-file not given
Removed explicit pushing models to Backup::Model.all
Model initializer already adds instance to Backup::Model.all array,
so adding it explicitely in before block caused Backup::Model.all
to contain duplicates.
Fixed wildcard matching
Model.find_matching returns model instances, but CLI::Utility.perform
method expects triggers. Added extracting triggers from matching models
before trying to perform backups.
Merge pull request #339 from jdutil/bump_fog
Bump fog dependency to 1.4.0.
add 'before' and 'after' hooks wrapping model definitions with custom…
… bits of code. Useful adding setup/tear-down to your backup config.
clean up hook api
add start/stop/err logging for hooks
... and apparently I should have made a feature branch (whoops). If it's a problem I can repackage.
+1 (though maybe 'cause it's been so long, could be worth cleaning up the commits to just include the hook specific ones)