From 5d3244c1c68d92db4941aec7b77f1826d92c14dd Mon Sep 17 00:00:00 2001 From: Pau Rodriguez-Estivill Date: Thu, 20 Aug 2020 22:54:24 +0200 Subject: [PATCH] Improved manual backup example --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 91def92..4437a31 100644 --- a/README.md +++ b/README.md @@ -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