https://github.com/andornaut/backup-docker-postgresql
Backup from and restore to local or remote Dockerized PostgreSQL databases
https://github.com/andornaut/backup-docker-postgresql
backup docker postgresql restore
Last synced: 3 months ago
JSON representation
Backup from and restore to local or remote Dockerized PostgreSQL databases
- Host: GitHub
- URL: https://github.com/andornaut/backup-docker-postgresql
- Owner: andornaut
- License: mit
- Created: 2016-08-07T03:23:43.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2017-06-06T00:43:58.000Z (about 9 years ago)
- Last Synced: 2025-01-05T01:11:57.512Z (over 1 year ago)
- Topics: backup, docker, postgresql, restore
- Language: Shell
- Homepage:
- Size: 7.81 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# backup-docker-postgresql
Backup from and restore to local or remote PostgreSQL databases, which are (optionally) running in Docker containers.
## Backup with [backupdockerpostgresql](./backupdockerpostgresql)
### Example
```
$ ./backupdockerpostgresql --kill --host user@example.com --container postgres backup.gz
```
### Usage
```
backupdockerpostgresql [--help] [--kill] [--host ] [--container ] [backup_file]
```
Flag | Argument | Description
--- | --- | ---
-c, --container | id or name | The id or name of the Docker container in which PostgreSQL is running. If omitted, then connect to the database running directly on the host.
-h, --host | hostname | The remote host to connect to
-k, --kill | | Close all other database connections
--help | | Print a help message and exit
Argument | Required |Description
--- | --- | ---
backup_file | no | The optional file to which to save the backup data. If not specified, then the backup data will be written to stdout
## Restore with [restoredockerpostgresql](./restoredockerpostgresql)
### Example
```
$ ./restoredockerpostgresql --kill --host user@example.com --container 376064e2a45e backup.gz
```
### Usage
```
restoredockerpostgresql [--help] [--drop] [--kill] [--host ] [--container ] [backup_file]
```
Flag | Argument | Description
--- | --- | ---
-c, --container | id or name | The id or name of the Docker container in which PostgreSQL is running. If omitted, then connect to the database running directly on the host.
-d, --drop | | Drop all non-template databases except for the one named "postgres"
-h, --host | hostname | The remote host to connect to
-k, --kill | | Close all other database connections
--help | | Print a help message and exit
Argument | Required |Description
--- | --- | ---
backup_file | no | The optional file from which to read the backup data. If not specified, then the backup data will be read from stdin