mirror of
https://github.com/prodrigestivill/docker-postgres-backup-local.git
synced 2026-07-05 01:38:05 +00:00
Document restore example improves issue #27
This commit is contained in:
@@ -100,3 +100,23 @@ You can change the `SCHEDULE` environment variable in `-e SCHEDULE="@daily"` to
|
|||||||
More information about the scheduling can be found [here](http://godoc.org/github.com/robfig/cron#hdr-Predefined_schedules).
|
More information about the scheduling can be found [here](http://godoc.org/github.com/robfig/cron#hdr-Predefined_schedules).
|
||||||
|
|
||||||
Folders `daily`, `weekly` and `monthly` are created and populated using hard links to save disk space.
|
Folders `daily`, `weekly` and `monthly` are created and populated using hard links to save disk space.
|
||||||
|
|
||||||
|
## Restore examples
|
||||||
|
|
||||||
|
Some examples to restore/apply the backups.
|
||||||
|
|
||||||
|
### Restore locally
|
||||||
|
|
||||||
|
Replace the backupfile name, `$CONTAINER`, `$USERNAME` and `$DBNAME` from the following command:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
zcat backupfile.sql.gz | docker exec --tty --interactive $CONTAINER psql --username=$USERNAME --dbname=$DBNAME -W
|
||||||
|
```
|
||||||
|
|
||||||
|
### Restore to a remote server
|
||||||
|
|
||||||
|
Replace the backupfile name, `$VERSION`, `$HOSTNAME`, `$PORT`, `$USERNAME` and `$DBNAME` from the following command:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
zcat backupfile.sql.gz | docker run --rm --tty --interactive postgres:$VERSION psql --host=$HOSTNAME --port=$PORT --username=$USERNAME --dbname=$DBNAME -W
|
||||||
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user