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
46 47 48 49 50 51 52 53 |
# File 'lib/chef/knife/backup_restore.rb', line 46 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 exisitng data" validate! components = name_args.empty? ? COMPONENTS : name_args Array(components).each { |component| self.send(component) } end |