Document restore example improves issue #27

This commit is contained in:
Pau Rodriguez-Estivill
2020-08-20 20:54:00 +02:00
parent 5d33982057
commit fbcabb4aac
+20
View File
@@ -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).
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
```