lib/s3backup/cli.rb in s3backup-0.8.6 vs lib/s3backup/cli.rb in s3backup-0.8.7
- old
+ new
@@ -1,9 +1,7 @@
require 'optparse'
require 'yaml'
-require 's3backup/s3log'
-
module S3backup
class CLI
DEFAULT_CONFIG='./backup.yml'
def self.execute(stdout, arguments=[])
@@ -50,18 +48,17 @@
end
if options[:log]
S3log.set_logfile(File.open(options[:log],"a"))
end
if options[:restore]
- require 's3backup/restore'
+ FileUtils.mkdir_p(options[:output_dir])
if !File.directory?(options[:output_dir])
S3log.error("output directory #{options[:output_dir]} is not exist.")
exit(-1)
end
rt = Restore.new(options[:output_dir],YAML.load_file(options[:config_file]))
rt.start
else
- require 's3backup/backup'
bk = Backup.new(YAML.load_file(options[:config_file]))
bk.start
end
end
end