Class: Backy::PgDump

Inherits:
Object
  • Object
show all
Includes:
AppConfig, Db
Defined in:
lib/backy/pg_dump.rb

Constant Summary collapse

DUMP_DIR =
"db/dump"
DUMP_CMD_OPTS =
"--no-acl --no-owner --no-subscriptions --no-publications"

Instance Method Summary collapse

Instance Method Details

#callObject



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/backy/pg_dump.rb', line 13

def call
  setup_backup_directory
  log_start

  dump_file = nil

  begin
    handle_replication { dump_file = backup }
  rescue => e
    Logger.error("An error occurred during backup: #{e.message}")
  ensure
    log_replication_resume if replica? && pause_replication?
  end

  dump_file
end