meskyanichi/backup — pull request #342 by thedeeno (2012-07-17 02:35:11+00:00)
Title: Add hooks for running ruby blocks before/after a backup run.

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:

```ruby
Backup::Model.new(:test_backup, 'backs up the local postgres instance') do
before do
# a ruby block for setup
end

after do
# a ruby block for teardown
end

# the rest of your configuraiton
end
```

These hooks will be called right after logging the 'backup started' message and right before logging the 'backup finished' message.

Each hooks also logs it's start, finish, or error message.

Tests included.