Class: ServerBackup::BackupRestore
- Inherits:
-
Chef::Knife
- Object
- Chef::Knife
- ServerBackup::BackupRestore
- Defined in:
- lib/chef/knife/backup_restore.rb
Instance Method Summary collapse
Instance Method Details
#run ⇒ Object
54 55 56 57 58 59 60 61 |
# File 'lib/chef/knife/backup_restore.rb', line 54 def run ui.warn "This will overwrite existing data!" ui.warn "Backup is at least 1 day old" if (Time.now - File.atime(config[:backup_dir])) > 86400 ui.confirm "Do you want to restore backup, possibly overwriting existing data" validate! components = name_args.empty? ? COMPONENTS : name_args Array(components).each { |component| self.send(component) } end |