PostgreSQL

Create PostgreSQL backup artifacts

postgresql_dump

Dumps a PostgreSQL database.

Typical Usage

host "db-host", hostname: "db.example.com"

job "db-backup" do
  resource "database", name: "my-database", host: "db-host"
  remotely as: "user" do
    postgresql_dump user: "postgresql-user", password: "secret", login_host: "localhost"
  end
end

Input resources

Resources of type database are allowed.

Output resource

A resource of type file.

Command options

OptionDescription
login_hostThe host to log into. While this information seems redundant, it may be sometimes required to match the appropriate authentication method defined in the pg_hba.conf file. See there for moreRequired: no
userThe user account to useRequired: no
passwordThe password to provideRequired: no
sudo_asRun the pg_dump command as another system userRequired: no