From 459fafd9ae6102675a630fd07041ca934cb35670 Mon Sep 17 00:00:00 2001 From: Jonas Thelemann Date: Tue, 19 Mar 2019 20:16:57 +0100 Subject: [PATCH 1/2] Rephrase README ~ Improves readability --- README.md | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 4c357cc..19f6ce2 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,7 @@ # postgres-backup-local -Backup PostgresSQL to local filesystem with periodic backups and rotate backups. -Based on [schickling/postgres-backup-s3](https://hub.docker.com/r/schickling/postgres-backup-s3/). -It can backup multiple databases from the same host by setting all databases in `POSTGRES_DB` separated by comas or spaces. +Backup PostgresSQL to the local filesystem with periodic rotating backups, based on [schickling/postgres-backup-s3](https://hub.docker.com/r/schickling/postgres-backup-s3/). +Backup multiple databases from the same host by setting the database names in `POSTGRES_DB` separated by commas or spaces. ## Usage @@ -48,35 +47,34 @@ services: ``` ### Environment Variables -Most variables are the same as [postgres official image](https://hub.docker.com/_/postgres/). +Most variables are the same as in the [official postgres image](https://hub.docker.com/_/postgres/). | env variable | description | |--|--| -| POSTGRES_HOST | postgres connection parameter; postgres host. | -| POSTGRES_DB | coma list of postgres databases to connect to. | +| POSTGRES_HOST | postgres connection parameter; postgres host to connect to. | +| POSTGRES_DB | comma or space separated list of postgres databases to backup. | | POSTGRES_USER | postgres connection parameter; postgres user to connect with. | | POSTGRES_PASSWORD | postgres connection parameter; postgres password to connect with. | -| POSTGRES_PASSWORD_FILE | alternative to POSTGRES_PASSWORD, to use with docker secrets. | -| POSTGRES_EXTRA_OPTS | additional options to supply `pg_dump` when creating back-ups. | -| SCHEDULE | [cron-schedule](http://godoc.org/github.com/robfig/cron#hdr-Predefined_schedules) specifying the interval between taking postgres backups. | -| BACKUP_KEEP_DAYS | number of days to keep backups before removal. | -| BACKUP_KEEP_WEEKS | number of weeks to keep backups before removal. | -| BACKUP_KEEP_MONTHS | number of months to keep backups before removal. | +| POSTGRES_PASSWORD_FILE | alternative to POSTGRES_PASSWORD, useful with docker secrets. | +| POSTGRES_EXTRA_OPTS | additional options for `pg_dump`. | +| SCHEDULE | [cron-schedule](http://godoc.org/github.com/robfig/cron#hdr-Predefined_schedules) specifying the interval between postgres backups. | +| BACKUP_KEEP_DAYS | number of daily backups to keep before removal. | +| BACKUP_KEEP_WEEKS | number of weekkly backups to keep before removal. | +| BACKUP_KEEP_MONTHS | number of monthly backups to keep before removal. | | HEALTHCHECK_PORT | Port listening for cron-schedule health check. | ### Manual Backups -By default it makes daily backups but you can start a manual one by running the command `/backup.sh`. +By default this container makes daily backups, but you can start a manual backup by running `/backup.sh`: -Example running only manual backup on Docker: ```sh $ docker run -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 -You can change the `SCHEDULE` environment variable like `-e SCHEDULE="@daily"` to change its default frequency, by default is daily. +You can change the `SCHEDULE` environment variable in `-e SCHEDULE="@daily"` to alter the default frequency. Default is `daily`. 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. From 700796b6e298d3d721ec7ff95d137ef298544912 Mon Sep 17 00:00:00 2001 From: Jonas Thelemann Date: Tue, 19 Mar 2019 20:18:09 +0100 Subject: [PATCH 2/2] Complete Environment Variable Description + Undocumented environment variables + Required / defaults description ~ Order alphabetically --- README.md | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 19f6ce2..0211560 100644 --- a/README.md +++ b/README.md @@ -51,17 +51,19 @@ Most variables are the same as in the [official postgres image](https://hub.dock | env variable | description | |--|--| -| POSTGRES_HOST | postgres connection parameter; postgres host to connect to. | -| POSTGRES_DB | comma or space separated list of postgres databases to backup. | -| POSTGRES_USER | postgres connection parameter; postgres user to connect with. | -| POSTGRES_PASSWORD | postgres connection parameter; postgres password to connect with. | -| POSTGRES_PASSWORD_FILE | alternative to POSTGRES_PASSWORD, useful with docker secrets. | -| POSTGRES_EXTRA_OPTS | additional options for `pg_dump`. | -| SCHEDULE | [cron-schedule](http://godoc.org/github.com/robfig/cron#hdr-Predefined_schedules) specifying the interval between postgres backups. | -| BACKUP_KEEP_DAYS | number of daily backups to keep before removal. | -| BACKUP_KEEP_WEEKS | number of weekkly backups to keep before removal. | -| BACKUP_KEEP_MONTHS | number of monthly backups to keep before removal. | -| HEALTHCHECK_PORT | Port listening for cron-schedule health check. | +| BACKUP_DIR | Directory to save the backup at. Defaults to `/backups`. | +| BACKUP_KEEP_DAYS | Number of daily backups to keep before removal. Defaults to `7`. | +| BACKUP_KEEP_WEEKS | Number of weekkly backups to keep before removal. Defaults to `4`. | +| BACKUP_KEEP_MONTHS | Number of monthly backups to keep before removal. Defaults to `6`. | +| HEALTHCHECK_PORT | Port listening for cron-schedule health check. Defaults to `8080`. | +| POSTGRES_DB | Comma or space separated list of postgres databases to backup. Required. | +| POSTGRES_EXTRA_OPTS | Additional options for `pg_dump`. Defaults to `-Z9`. | +| POSTGRES_HOST | Postgres connection parameter; postgres host to connect to. Required. | +| POSTGRES_PASSWORD | Postgres connection parameter; postgres password to connect with. Required. | +| POSTGRES_PASSWORD_FILE | Alternative to POSTGRES_PASSWORD, useful with docker secrets. | +| POSTGRES_PORT | Postgres connection parameter; postgres port to connect to. Defaults to `5432`. | +| POSTGRES_USER | Postgres connection parameter; postgres user to connect with. Required. | +| SCHEDULE | [Cron-schedule](http://godoc.org/github.com/robfig/cron#hdr-Predefined_schedules) specifying the interval between postgres backups. Defaults to `@daily`. | ### Manual Backups