Class: Postgres::Clone::Executable

Inherits:
Thor
  • Object
show all
Includes:
Commands
Defined in:
lib/postgres/clone/executable.rb

Constant Summary

Constants included from Logger

Logger::DEFAULT_COLOR

Instance Method Summary collapse

Methods included from Commands

#copy_file, #current_user, #disk_usage, #file_exists?, #file_exists_command, #free_disk_space_command, #local_host?, #postgres_create_database, #postgres_create_database_command, #postgres_dump_database, #postgres_dump_database_command, #postgres_restore_database, #postgres_restore_database_command, #print_host_disk_space, #user_password

Methods included from RemoteCommands

#close_ssh_connections, #open_ssh_connection, #run_remote, #sudo_remote

Methods included from Logger

#log_message

Methods included from CommandLine

#build_command, #log_command

Methods included from LocalCommands

#run_local, #sudo_local

Instance Method Details

#clone_databaseObject



16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/postgres/clone/executable.rb', line 16

def clone_database
  print_hosts_disk_space

  if options[:src_host] == options[:dst_host]
    create_database_using_template
  else
    create_database_using_restore
  end

  print_hosts_disk_space

  close_ssh_connections
end