Backup PostgreSQL Database on Linux

Exported on 15-Nov-2021 14:57:27

Backup Postgres Databases With AttuneOps on Linux

This Blueprint Creates A Backup For Specified MongoDB Database on Linux

Postgres is a relational database Management system. This blueprint takes the following parameter to create the Postgres backup file.

  • postgresConnectionUri: Postgres Connection URI, example: mongo://username@host:port/database
  • postgresBackupDestination: MongoDB Database backup file destination, should be a file path.
Pre-Blueprint Attune setup
  1. On the Inputs tab, create a Windows node for the host you wish to install the stack on.
  2. On the Inputs tab, create Windows credentials to connect to the host you wish to install the stack on.
Steps Involved
  • Create Postgres Backup


Name Type Script Reference Default Value Comment
Linux Linux / Unix Server linux
Linux Credential Linux OS Credential linuxCredential
Postgres Backup Destination Text postgresBackupDestination
Postgres Connection URI Text postgresConnectionUri

1 - Backup Postgres Database

This step has the following parameters

Name Script Reference Default Value
Postgres Connection URI {postgresConnectionUri} None
Postgres Backup Destination {postgresBackupDestination} None
The connection details have changed from the last step.

Login as user on node

Connect via SSH
ssh user@hostname
This is a Bash Script make sure you run it with bash -l from a terminal session
# Create a backup file for Postgres Database
pg_dump {postgresConnectionUri} > {postgresBackupDestination}