Class: ForemanMaintain::Cli::RestoreCommand

Inherits:
Base
  • Object
show all
Defined in:
lib/foreman_maintain/cli/restore_command.rb

Instance Attribute Summary

Attributes inherited from Base

#runner

Instance Method Summary collapse

Methods inherited from Base

#available_checks, #available_procedures, available_tags, #available_tags, completion_map, completion_types, dashize, #dashize, delete_duplicate_assumeyes_if_any, interactive_option, label_option, #label_string, option, #option_wrapper, parameter, #print_check_info, #reporter, #run_scenario, #run_scenarios_and_exit, service_options, subcommand, #tag_string, tags_option, #underscorize

Methods included from ForemanMaintain::Concerns::Logger

#logger

Methods included from ForemanMaintain::Concerns::Finders

#check, #detector, #feature, #find_all_scenarios, #find_checks, #find_procedures, #find_scenarios, #procedure

Instance Method Details

#executeObject



11
12
13
14
15
16
17
18
19
# File 'lib/foreman_maintain/cli/restore_command.rb', line 11

def execute
  scenario = Scenarios::Restore.new(
    :backup_dir => @backup_dir,
    :incremental_backup => @incremental || incremental_backup?
  )
  rescue_scenario = Scenarios::RestoreRescue.new
  run_scenario(scenario, rescue_scenario)
  exit runner.exit_code
end

#incremental_backup?Boolean

Returns:

  • (Boolean)


21
22
23
24
# File 'lib/foreman_maintain/cli/restore_command.rb', line 21

def incremental_backup?
  backup = ForemanMaintain::Utils::Backup.new(@backup_dir)
  backup.incremental?
end