Class: ChefBackup::Strategy::ObjectBackup

Inherits:
TarBackup
  • Object
show all
Defined in:
lib/chef_backup/strategy/backup/object.rb

Overview

ChefBackup::Object class. Used to backup all stateful services as an object and stored locally in a filesystem structure in JSON.

Constant Summary

Constants inherited from TarBackup

TarBackup::DEFAULT_STATEFUL_SERVICES

Constants included from Helpers

Helpers::DEFAULT_PG_OPTIONS, Helpers::SERVER_ADD_ONS

Instance Attribute Summary

Attributes inherited from TarBackup

#backup_time

Instance Method Summary collapse

Methods inherited from TarBackup

#add_ha_services, #ask_to_go_offline, #chpst, #config_directories, #config_only?, #create_tarball, #data_map, #dump_db, #export_dir, #export_filename, #export_tarball, #external_pg?, #initialize, #manifest, #not_implemented, #offline_permission_granted?, #pg_dump?, #pg_dumpall, #populate_data_map, #populate_versions, #project_names, #service_enabled?, #stateful_services, #write_manifest

Methods included from Helpers

#addon_install_dir, #all_services, #backend?, #base_config_dir, #base_install_dir, #chpst, #cleanup, #config, #config_base, #ctl_command, #database_name, #disabled_services, #enabled_addons, #enabled_services, #ensure_file!, #frontend?, #ha?, #log, #marketplace?, #online?, #pg_options, #pgsql, #project_name, #reconfigure_add_ons, #reconfigure_marketplace, #restart_add_ons, #restart_chef_server, #running_filepath, #service_config, #service_enabled?, #shell_out, #shell_out!, #shell_timeout, #standalone?, #start_chef_server, #start_service, #stop_chef_server, #stop_service, #strategy, #tier?, #tmp_dir, #topology, #version_from_manifest_file

Constructor Details

This class inherits a constructor from ChefBackup::Strategy::TarBackup

Instance Method Details

#backupObject

  • object

    • Make tmp directory

    • Ensure backup directory exists

    • Warn if backups directory or tmp are low on space

    • knife-ec-backup into temp directory

    • Create backup manifest

    • Create gzipped tarball of all required files

      • knife ec backup dump

      • /etc/opscode

      • Backup manifest

    • Cleanup tmp directories



15
16
17
18
19
20
21
22
# File 'lib/chef_backup/strategy/backup/object.rb', line 15

def backup
  ensure_tmp_dir
  verify_object
  knife_ec_backup
  create_manifest
  create_tarball
  cleanup
end

#knife_ec_backupObject



26
# File 'lib/chef_backup/strategy/backup/object.rb', line 26

def knife_ec_backup; end

#verify_objectObject



24
# File 'lib/chef_backup/strategy/backup/object.rb', line 24

def verify_object; end