11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# File 'lib/backup.rb', line 11
def self.start(options)
@@options = options
@configuration = Backup::Configuration::Base.new
@configuration.instance_eval { eval File.read(options[:config]) }
@configuration.storage.map do |storage_key, storage_value|
@configuration.server.map do |name, config|
next if options[:name].size > 0 && options[:name].select {|n| n == name }.size == 0
server = Backup::Server.new
server.name = name
server.config = config
server.storage = Backup::Storage.new(storage_key, storage_value)
server.backup
end
end
end
|