287
|
1 #!/bin/bash
|
|
2 # Executes a database backup for the specified database container.
|
|
3 # The current directory is expected to contain a project configured
|
|
4 # as with SSDT conventions for an application database.
|
|
5 #
|
|
6 # When successful, the output file will be in ./backup with the
|
|
7 # container name and timestamp in the file.
|
|
8 # The file will also be placed on the specified remote target
|
|
9 # The format of the output is a compressed pg_dump (sql) format.
|
|
10 # along with the top level contents of the project directory
|
|
11 # Environment variables can be used for REMOTE_BACKUP_TARGET and REMOTE_USERNAME
|
|
12 #
|
|
13
|
|
14
|
|
15 container=${1?Must provide container name to backup}
|
|
16 remoteTarget=${2:-$REMOTE_BACKUP_TARGET}
|
|
17 userName=${3:-$REMOTE_USERNAME}
|
|
18 projectDir=${4:-$PWD}
|
|
19
|
aldrich@nwoca.org
parents:
|