Improved manual backup example

This commit is contained in:
Pau Rodriguez-Estivill
2020-08-20 22:54:24 +02:00
parent 22ada6f6a2
commit 5d3244c1c6
+4 -2
View File
@@ -90,10 +90,12 @@ This variables are not intended to be used for normal deployment operations:
### Manual Backups
By default this container makes daily backups, but you can start a manual backup by running `/backup.sh`:
By default this container makes daily backups, but you can start a manual backup by running `/backup.sh`.
This script as example creates one backup as the running user and saves it the working folder.
```sh
docker run -u postgres:postgres -e POSTGRES_HOST=postgres -e POSTGRES_DB=dbname -e POSTGRES_USER=user -e POSTGRES_PASSWORD=password prodrigestivill/postgres-backup-local /backup.sh
docker run --rm -v "$PWD:/backups" -u "$(id -u):$(id -g)" -e POSTGRES_HOST=postgres -e POSTGRES_DB=dbname -e POSTGRES_USER=user -e POSTGRES_PASSWORD=password prodrigestivill/postgres-backup-local /backup.sh
```
### Automatic Periodic Backups