class PostgreBackup

Public Instance Methods

backup_command() click to toggle source
# File lib/backup/postgre_backup.rb, line 8
def backup_command
  "#{"PGPASSWORD=#{password}" if password} pg_dump --clean --if-exists --no-owner #{"--host=#{host}" if host} #{"--username=#{user}" if user} #{database}"
end
db_list() click to toggle source
# File lib/backup/postgre_backup.rb, line 12
def db_list
  @db_list ||= (`#{"PGPASSWORD=#{password}" if password} psql #{"--host=#{host}" if host} #{"--username=#{user}" if user} -t -c 'SELECT datname FROM pg_database WHERE datistemplate = false;'`.split.compact - ['root'])
end
print_info() click to toggle source