class Bosh::Cli::Command::Backup
Public Instance Methods
backup(path=nil)
click to toggle source
# File lib/cli/commands/backup.rb, line 7 def backup(path=nil) auth_required show_current_state path = backup_destination_path(path) status, task_id = director.create_backup if status == :done tmp_path = director.fetch_backup FileUtils.mv(tmp_path, path) say("Backup of BOSH director was put in '#{path.make_green}'.") else [status, task_id] end end
Private Instance Methods
backup_destination_path(dest_path)
click to toggle source
# File lib/cli/commands/backup.rb, line 30 def backup_destination_path(dest_path) path = Bosh::Cli::BackupDestinationPath.new(director).create_from_path(dest_path) if File.exists?(path) && !force? err("There is already an existing file at '#{path}'. " + 'To overwrite it use the --force option.') end path end
force?()
click to toggle source
# File lib/cli/commands/backup.rb, line 26 def force? !!options[:force] end